Browse Source

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

pull/4287/head
Zaki Manian 5 years ago
committed by Jack Zampolin
parent
commit
0354ea87f7
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