mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
p2p: send EIP-8 auth when RLPX_EIP8 is set in env
This commit is contained in:
parent
caf3ad1e85
commit
2817d1d6dc
1 changed files with 7 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
mrand "math/rand"
|
mrand "math/rand"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -271,7 +272,12 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, err
|
return s, err
|
||||||
}
|
}
|
||||||
authPacket, err := authMsg.sealPlain(h)
|
var authPacket []byte
|
||||||
|
if os.Getenv("RLPX_EIP8") != "" {
|
||||||
|
authPacket, err = sealEIP8(authMsg, h)
|
||||||
|
} else {
|
||||||
|
authPacket, err = authMsg.sealPlain(h)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return s, err
|
return s, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue