Skip to content

Commit

Permalink
multiple certificate types for the node are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilong committed Mar 8, 2023
1 parent c7c418f commit 8e6507a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions p2p/conn/secret_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"golang.org/x/crypto/nacl/box"

"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/algo"
cryptoenc "github.com/tendermint/tendermint/crypto/encoding"
"github.com/tendermint/tendermint/libs/async"
"github.com/tendermint/tendermint/libs/protoio"
Expand Down Expand Up @@ -167,8 +166,11 @@ func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKey) (*
}

remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
if !algo.VerifyPubKeyType(remPubKey) {
return nil, fmt.Errorf("expected %s pubkey, got %T", algo.Algo, remPubKey)
//if !algo.VerifyPubKeyType(remPubKey) {
// return nil, fmt.Errorf("expected %s pubkey, got %T", algo.Algo, remPubKey)
//}
if remPubKey == nil {
return nil, errors.New("peer sent a nil public key")
}
if !remPubKey.VerifySignature(challenge[:], remSignature) {
return nil, errors.New("challenge verification failed")
Expand Down

0 comments on commit 8e6507a

Please sign in to comment.