noise: unify zero checking of ecdh
This commit is contained in:
parent
b33219c2cf
commit
4739708ca4
3 changed files with 49 additions and 63 deletions
|
|
@ -240,9 +240,6 @@ func (device *Device) SetPrivateKey(sk NoisePrivateKey) error {
|
|||
for _, peer := range device.peers.keyMap {
|
||||
handshake := &peer.handshake
|
||||
handshake.precomputedStaticStatic = device.staticIdentity.privateKey.sharedSecret(handshake.remoteStatic)
|
||||
if isZero(handshake.precomputedStaticStatic[:]) {
|
||||
panic("an invalid peer public key made it into the configuration")
|
||||
}
|
||||
expiredPeers = append(expiredPeers, peer)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue