aboutsummaryrefslogtreecommitdiffstats
path: root/device/device.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-02-16 15:51:30 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2023-02-16 16:33:14 +0100
commitc7b76d3d9ecdc2ffde80decadda88c0c7cdfeedf (patch)
tree801fe59cc2d9c203de1dd69bf5cf15bf5d097186 /device/device.go
parenttun: guard Device.Events() against chan writes (diff)
downloadwireguard-go-c7b76d3d9ecdc2ffde80decadda88c0c7cdfeedf.tar.xz
wireguard-go-c7b76d3d9ecdc2ffde80decadda88c0c7cdfeedf.zip
device: uniformly check ECDH output for zeros
For some reason, this was omitted for response messages. Reported-by: z <dzm@unexpl0.red> Fixes: 8c34c4c ("First set of code review patches") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/device.go')
-rw-r--r--device/device.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/device.go b/device/device.go
index 8e55724..3368a93 100644
--- a/device/device.go
+++ b/device/device.go
@@ -265,7 +265,7 @@ func (device *Device) SetPrivateKey(sk NoisePrivateKey) error {
expiredPeers := make([]*Peer, 0, len(device.peers.keyMap))
for _, peer := range device.peers.keyMap {
handshake := &peer.handshake
- handshake.precomputedStaticStatic = device.staticIdentity.privateKey.sharedSecret(handshake.remoteStatic)
+ handshake.precomputedStaticStatic, _ = device.staticIdentity.privateKey.sharedSecret(handshake.remoteStatic)
expiredPeers = append(expiredPeers, peer)
}