From 613d6eafa307c6881a737a3c35c0e312e8d3a8c5 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Fri, 27 Apr 2018 00:10:38 +0100 Subject: [PATCH] ssh: fix copy and paste error Doesn't matter because contentKey and lengthKey are the same length, but we should really be looping over lengthKey here. Change-Id: Ic7af3c553eb4382239bec1c030e77c7f5baa0662 Reviewed-on: https://go-review.googlesource.com/109735 Run-TryBot: Michael Munday Reviewed-by: Brad Fitzpatrick --- ssh/cipher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh/cipher.go b/ssh/cipher.go index 4965bdf542..67b0126105 100644 --- a/ssh/cipher.go +++ b/ssh/cipher.go @@ -659,7 +659,7 @@ func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionA for i := range c.contentKey { c.contentKey[i] = binary.LittleEndian.Uint32(key[i*4 : (i+1)*4]) } - for i := range c.contentKey { + for i := range c.lengthKey { c.lengthKey[i] = binary.LittleEndian.Uint32(key[(i+8)*4 : (i+9)*4]) } return c, nil