From b9b3efb09f9281a5859646d2dcf36b5813132efb Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 9 Jan 2017 11:16:06 +0100 Subject: all: fix ineffectual assignments and remove uses of crypto.Sha3 go get github.com/gordonklaus/ineffassign ineffassign . --- p2p/rlpx.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'p2p') diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 2a9bdc121..c6fd841f7 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -429,7 +429,7 @@ func (msg *authMsgV4) decodePlain(input []byte) { n := copy(msg.Signature[:], input) n += shaLen // skip sha3(initiator-ephemeral-pubk) n += copy(msg.InitiatorPubkey[:], input[n:]) - n += copy(msg.Nonce[:], input[n:]) + copy(msg.Nonce[:], input[n:]) msg.Version = 4 msg.gotPlain = true } @@ -437,13 +437,13 @@ func (msg *authMsgV4) decodePlain(input []byte) { func (msg *authRespV4) sealPlain(hs *encHandshake) ([]byte, error) { buf := make([]byte, authRespLen) n := copy(buf, msg.RandomPubkey[:]) - n += copy(buf[n:], msg.Nonce[:]) + copy(buf[n:], msg.Nonce[:]) return ecies.Encrypt(rand.Reader, hs.remotePub, buf, nil, nil) } func (msg *authRespV4) decodePlain(input []byte) { n := copy(msg.RandomPubkey[:], input) - n += copy(msg.Nonce[:], input[n:]) + copy(msg.Nonce[:], input[n:]) msg.Version = 4 } -- cgit