aboutsummaryrefslogtreecommitdiff
path: root/device/peer.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/peer.go
parent1e2c3e5a3c1463cb8c7ec92d74aa739587b6642f (diff)
downloadwireguard-go-c7b76d3d9ecdc2ffde80decadda88c0c7cdfeedf.tar.gz
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/peer.go')
-rw-r--r--device/peer.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/peer.go b/device/peer.go
index 8266dac..0e7b669 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -92,7 +92,7 @@ func (device *Device) NewPeer(pk NoisePublicKey) (*Peer, error) {
// pre-compute DH
handshake := &peer.handshake
handshake.mutex.Lock()
- handshake.precomputedStaticStatic = device.staticIdentity.privateKey.sharedSecret(pk)
+ handshake.precomputedStaticStatic, _ = device.staticIdentity.privateKey.sharedSecret(pk)
handshake.remoteStatic = pk
handshake.mutex.Unlock()