Upstep Go dependencies (#340)

* Upstep Go dependencies

* tiny linter fix

* Tidy
This commit is contained in:
tobi 2021-12-12 15:47:51 +01:00 committed by GitHub
commit 67ac8db190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
160 changed files with 248601 additions and 232400 deletions

View file

@ -394,6 +394,10 @@ func (c *gcmCipher) readCipherPacket(seqNum uint32, r io.Reader) ([]byte, error)
}
c.incIV()
if len(plain) == 0 {
return nil, errors.New("ssh: empty packet")
}
padding := plain[0]
if padding < 4 {
// padding is a byte, so it automatically satisfies
@ -710,6 +714,10 @@ func (c *chacha20Poly1305Cipher) readCipherPacket(seqNum uint32, r io.Reader) ([
plain := c.buf[4:contentEnd]
s.XORKeyStream(plain, plain)
if len(plain) == 0 {
return nil, errors.New("ssh: empty packet")
}
padding := plain[0]
if padding < 4 {
// padding is a byte, so it automatically satisfies