• R/O
  • HTTP
  • SSH
  • HTTPS

bytom: Commit

Official Go implementation of the Bytom protocol


Commit MetaInfo

Révision5d5c9ef7d6813fe5dd82b36aa35d80a745a274ca (tree)
l'heure2019-10-12 21:01:45
AuteurYahtoo Ma <yahtoo.ma@gmai...>
CommiterYahtoo Ma

Message de Log

Only allow ed25519 pubkeys when connecting

Change Summary

Modification

--- a/p2p/connection/secret_connection.go
+++ b/p2p/connection/secret_connection.go
@@ -87,7 +87,12 @@ func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKeyEd25
8787 if err != nil {
8888 return nil, err
8989 }
90+
9091 remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
92+ if _, ok := remPubKey.PubKeyInner.(crypto.PubKeyEd25519); !ok {
93+ return nil, errors.New("peer sent a nil public key")
94+ }
95+
9196 if !remPubKey.VerifyBytes(challenge[:], remSignature) {
9297 return nil, errors.New("Challenge verification failed")
9398 }
Afficher sur ancien navigateur de dépôt.