mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
wgengine/magicsock: remove dead code (#8745)
The nonce value is not read by anything, and di.sharedKey.Seal() a few lines below generates its own. #cleanup Signed-off-by: salman <salman@tailscale.com>
This commit is contained in:
parent
0554deb48c
commit
68f8e5678e
@ -8,7 +8,6 @@
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
crand "crypto/rand"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -1242,10 +1241,6 @@ func (c *Conn) sendDiscoMessage(dst netip.AddrPort, dstKey key.NodePublic, dstDi
|
|||||||
c.mu.Unlock()
|
c.mu.Unlock()
|
||||||
return false, errConnClosed
|
return false, errConnClosed
|
||||||
}
|
}
|
||||||
var nonce [disco.NonceLen]byte
|
|
||||||
if _, err := crand.Read(nonce[:]); err != nil {
|
|
||||||
panic(err) // worth dying for
|
|
||||||
}
|
|
||||||
pkt := make([]byte, 0, 512) // TODO: size it correctly? pool? if it matters.
|
pkt := make([]byte, 0, 512) // TODO: size it correctly? pool? if it matters.
|
||||||
pkt = append(pkt, disco.Magic...)
|
pkt = append(pkt, disco.Magic...)
|
||||||
pkt = c.discoPublic.AppendTo(pkt)
|
pkt = c.discoPublic.AppendTo(pkt)
|
||||||
|
Loading…
Reference in New Issue
Block a user