Browse Source

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

v0.31.9-changelog
Zaki Manian 5 years ago
committed by Jack Zampolin
parent
commit
ebfaf30705
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      p2p/conn/secret_connection.go

+ 5
- 0
p2p/conn/secret_connection.go View File

@ -133,6 +133,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")
}


Loading…
Cancel
Save