mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-12 20:10:23 +08:00
device: fix races from changing private_key
Access keypair.sendNonce atomically. Eliminate one unnecessary initialization to zero. Mutate handshake.lastSentHandshake with the mutex held. Co-authored-by: David Anderson <danderson@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:

committed by
Jason A. Donenfeld

parent
c8faa34cde
commit
70861686d3
@@ -566,7 +566,6 @@ func (peer *Peer) BeginSymmetricSession() error {
|
||||
setZero(recvKey[:])
|
||||
|
||||
keypair.created = time.Now()
|
||||
keypair.sendNonce = 0
|
||||
keypair.replayFilter.Reset()
|
||||
keypair.isInitiator = isInitiator
|
||||
keypair.localIndex = peer.handshake.localIndex
|
||||
|
Reference in New Issue
Block a user