mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 13:06:40 +00:00
p2p: verify protocol handshake node ID
This commit is contained in:
parent
7d39fd6678
commit
21649100b1
1 changed files with 3 additions and 0 deletions
|
|
@ -89,6 +89,9 @@ func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake) (
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if rhs.ID != secrets.RemoteID {
|
||||||
|
return nil, errors.New("node ID in protocol handshake does not match encryption handshake")
|
||||||
|
}
|
||||||
// TODO: validate that handshake node ID matches
|
// TODO: validate that handshake node ID matches
|
||||||
if err := writeProtocolHandshake(rw, our); err != nil {
|
if err := writeProtocolHandshake(rw, our); err != nil {
|
||||||
return nil, fmt.Errorf("protocol write error: %v", err)
|
return nil, fmt.Errorf("protocol write error: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue