merged some things together

This commit is contained in:
херетик
2023-02-17 22:15:09 +00:00
parent d5c7a4a18d
commit 742158c49e
36 changed files with 129 additions and 146 deletions

View File

@@ -4,7 +4,6 @@ import (
"time"
"git-indra.lan/indra-labs/indra/pkg/crypto/nonce"
"git-indra.lan/indra-labs/indra/pkg/onion"
"git-indra.lan/indra-labs/indra/pkg/traffic"
"git-indra.lan/indra-labs/indra/pkg/util/slice"
)
@@ -19,7 +18,7 @@ func (eng *Engine) SendExit(port uint16, message slice.Bytes, id nonce.ID,
se := eng.SelectHops(hops, s)
var c traffic.Circuit
copy(c[:], se)
o := onion.SendExit(port, message, id, se[len(se)-1], c, eng.KeySet)
o := SendExit(port, message, id, se[len(se)-1], c, eng.KeySet)
log.D.Ln("sending out exit onion")
res := eng.PostAcctOnion(o)
eng.SendWithOneHook(c[0].AddrPort, res, hook)
@@ -27,19 +26,19 @@ func (eng *Engine) SendExit(port uint16, message slice.Bytes, id nonce.ID,
func (eng *Engine) MakeExit(port uint16, message slice.Bytes, id nonce.ID,
target *traffic.Session) (c traffic.Circuit,
o onion.Skins) {
o Skins) {
hops := []byte{0, 1, 2, 3, 4, 5}
s := make(traffic.Sessions, len(hops))
s[2] = target
se := eng.SelectHops(hops, s)
copy(c[:], se)
o = onion.SendExit(port, message, id, se[len(se)-1], c, eng.KeySet)
o = SendExit(port, message, id, se[len(se)-1], c, eng.KeySet)
return
}
func (eng *Engine) SendExitNew(c traffic.Circuit,
o onion.Skins, hook func(id nonce.ID, b slice.Bytes),
o Skins, hook func(id nonce.ID, b slice.Bytes),
timeout time.Duration) {
log.D.Ln("sending out exit onion")