|
|
@ -31,7 +31,6 @@ import ( |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
mrand "math/rand" |
|
|
|
mrand "math/rand" |
|
|
|
"net" |
|
|
|
"net" |
|
|
|
"os" |
|
|
|
|
|
|
|
"sync" |
|
|
|
"sync" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
@ -262,8 +261,6 @@ func (h *encHandshake) staticSharedSecret(prv *ecdsa.PrivateKey) ([]byte, error) |
|
|
|
return ecies.ImportECDSA(prv).GenerateShared(h.remotePub, sskLen, sskLen) |
|
|
|
return ecies.ImportECDSA(prv).GenerateShared(h.remotePub, sskLen, sskLen) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var configSendEIP = os.Getenv("RLPX_EIP8") != "" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initiatorEncHandshake negotiates a session token on conn.
|
|
|
|
// initiatorEncHandshake negotiates a session token on conn.
|
|
|
|
// it should be called on the dialing side of the connection.
|
|
|
|
// it should be called on the dialing side of the connection.
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -274,12 +271,7 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return s, err |
|
|
|
return s, err |
|
|
|
} |
|
|
|
} |
|
|
|
var authPacket []byte |
|
|
|
authPacket, err := sealEIP8(authMsg, h) |
|
|
|
if configSendEIP { |
|
|
|
|
|
|
|
authPacket, err = sealEIP8(authMsg, h) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
authPacket, err = authMsg.sealPlain(h) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return s, err |
|
|
|
return s, err |
|
|
|
} |
|
|
|
} |
|
|
|