From c7b76d3d9ecdc2ffde80decadda88c0c7cdfeedf Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 16 Feb 2023 15:51:30 +0100 Subject: device: uniformly check ECDH output for zeros For some reason, this was omitted for response messages. Reported-by: z Fixes: 8c34c4c ("First set of code review patches") Signed-off-by: Jason A. Donenfeld --- device/device.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'device/device.go') 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) } -- cgit v1.2.3-54-g00ecf