mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
Fix for panic in signature verification if a peer sends a nil public key.
This commit is contained in:
parent
797a3f6c16
commit
ebfaf30705
@ -133,6 +133,11 @@ func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKey) (*
|
|||||||
}
|
}
|
||||||
|
|
||||||
remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
|
remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
|
||||||
|
|
||||||
|
if remPubKey == nil {
|
||||||
|
return nil, errors.New("Peer sent a nil public key")
|
||||||
|
}
|
||||||
|
|
||||||
if !remPubKey.VerifyBytes(challenge[:], remSignature) {
|
if !remPubKey.VerifyBytes(challenge[:], remSignature) {
|
||||||
return nil, errors.New("Challenge verification failed")
|
return nil, errors.New("Challenge verification failed")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user