diff options
author | Felix Lange <fjl@twurst.com> | 2017-01-09 18:16:06 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-01-09 23:24:42 +0800 |
commit | b9b3efb09f9281a5859646d2dcf36b5813132efb (patch) | |
tree | f9dc8f9d82108b33bec4669b09a99d06d24239a9 /p2p | |
parent | 0f34d506b5ae9b76de97318c906e56dddd5309f6 (diff) | |
download | dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.gz dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.tar.zst dexon-b9b3efb09f9281a5859646d2dcf36b5813132efb.zip |
all: fix ineffectual assignments and remove uses of crypto.Sha3
go get github.com/gordonklaus/ineffassign
ineffassign .
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/rlpx.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |