aboutsummaryrefslogtreecommitdiff
path: root/ssh/cipher.go
diff options
context:
space:
mode:
authorKevin Burke <kev@inburke.com>2017-11-27 20:39:32 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2017-11-28 17:48:09 +0000
commite8f229864d71a49e5fdc4a9a134c5f85c4c33d64 (patch)
treed40198047e72be3bf3c9585764ceae27354a7f0f /ssh/cipher.go
parent48a5a650cfc529a2517eb6a4d6d6749872520525 (diff)
downloadgo-x-crypto-e8f229864d71a49e5fdc4a9a134c5f85c4c33d64.tar.xz
all: fix errors reported by vet, golint
None are "wrong" per se, but there are a lot of good suggestions and in one case a docstring that was not present in godoc due to the presence of an extra newline. Changed "Id" in struct properties to "ID" in some non-exported structs. Removed a trailing period from some error messages; I believe the exact contents of error strings are not covered by the Go compatibility promise. Change-Id: I7c620582dc247396f72c52d38c909ccc0ec87b83 Reviewed-on: https://go-review.googlesource.com/80145 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'ssh/cipher.go')
-rw-r--r--ssh/cipher.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh/cipher.go b/ssh/cipher.go
index aed2b1f..e67c5e0 100644
--- a/ssh/cipher.go
+++ b/ssh/cipher.go
@@ -372,7 +372,7 @@ func (c *gcmCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) {
}
length := binary.BigEndian.Uint32(c.prefix[:])
if length > maxPacket {
- return nil, errors.New("ssh: max packet length exceeded.")
+ return nil, errors.New("ssh: max packet length exceeded")
}
if cap(c.buf) < int(length+gcmTagSize) {
@@ -548,11 +548,11 @@ func (c *cbcCipher) readPacketLeaky(seqNum uint32, r io.Reader) ([]byte, error)
c.packetData = c.packetData[:entirePacketSize]
}
- if n, err := io.ReadFull(r, c.packetData[firstBlockLength:]); err != nil {
+ n, err := io.ReadFull(r, c.packetData[firstBlockLength:])
+ if err != nil {
return nil, err
- } else {
- c.oracleCamouflage -= uint32(n)
}
+ c.oracleCamouflage -= uint32(n)
remainingCrypted := c.packetData[firstBlockLength:macStart]
c.decrypter.CryptBlocks(remainingCrypted, remainingCrypted)