Skip to content

Commit 68f8e56

Browse files
authored
wgengine/magicsock: remove dead code (tailscale#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>
1 parent 0554deb commit 68f8e56

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

wgengine/magicsock/magicsock.go

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package magicsock
88
import (
99
"bufio"
1010
"context"
11-
crand "crypto/rand"
1211
"errors"
1312
"fmt"
1413
"io"
@@ -1242,10 +1241,6 @@ func (c *Conn) sendDiscoMessage(dst netip.AddrPort, dstKey key.NodePublic, dstDi
12421241
c.mu.Unlock()
12431242
return false, errConnClosed
12441243
}
1245-
var nonce [disco.NonceLen]byte
1246-
if _, err := crand.Read(nonce[:]); err != nil {
1247-
panic(err) // worth dying for
1248-
}
12491244
pkt := make([]byte, 0, 512) // TODO: size it correctly? pool? if it matters.
12501245
pkt = append(pkt, disco.Magic...)
12511246
pkt = c.discoPublic.AppendTo(pkt)

0 commit comments

Comments
 (0)