almost dxing

This commit is contained in:
херетик
2023-02-10 15:44:36 +00:00
parent 1ea60d6ffe
commit cf2c512cc7
32 changed files with 479 additions and 141 deletions

View File

@@ -23,3 +23,24 @@ func (eng *Engine) SendExit(port uint16, message slice.Bytes, id nonce.ID,
log.D.Ln("sending out exit onion")
eng.SendOnion(c[0].AddrPort, o, hook, timeout)
}
func (eng *Engine) MakeExit(port uint16, message slice.Bytes, id nonce.ID,
target *traffic.Session) (c traffic.Circuit,
o onion.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)
return
}
func (eng *Engine) SendExitNew(c traffic.Circuit,
o onion.Skins, hook func(id nonce.ID, b slice.Bytes),
timeout time.Duration) {
log.D.Ln("sending out exit onion")
eng.SendOnion(c[0].AddrPort, o, hook, timeout)
}