Skip to content

Commit

Permalink
Merge pull request #97 from irisnet/hotfix/v0.31.0
Browse files Browse the repository at this point in the history
Fix for panic in signature verification if a peer sends a nil public key
  • Loading branch information
Haifeng Xi authored Oct 2, 2019
2 parents 6258e4d + 8c84f7b commit b2f339e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions p2p/conn/secret_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,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")
}
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
// TMCoreSemVer is the current version of Tendermint Core.
// It's the Semantic Version of the software.
// Must be a string because scripts like dist.sh read this file.
TMCoreSemVer = "0.31.0"
TMCoreSemVer = "0.31.1"

// ABCISemVer is the semantic version of the ABCI library
ABCISemVer = "0.15.0"
Expand Down

0 comments on commit b2f339e

Please sign in to comment.