Fix for panic in signature verification if a peer sends a nil public key.

This commit is contained in:
Zaki Manian
2019-09-20 09:37:49 -07:00
committed by Jack Zampolin
parent cb7aea79db
commit 3a0cdda4c2
+5
View File
@@ -122,6 +122,11 @@ func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKey) (*
}
remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
if remPubKey == nil {
return nil, errors.New("Peer sent a nil public key")
}
if !remPubKey.VerifyBytes(challenge[:], remSignature) {
return nil, errors.New("Challenge verification failed")
}