diff options
author | 2021-12-12 15:47:51 +0100 | |
---|---|---|
committer | 2021-12-12 15:47:51 +0100 | |
commit | 67ac8db190eb82a7758746fb021fa3014f4241b7 (patch) | |
tree | 4a4124ad8f0ee9ec8858b109dd0bcc2e567fc144 /vendor/golang.org/x/crypto/ssh | |
parent | upstep dependencies (#339) (diff) | |
download | gotosocial-67ac8db190eb82a7758746fb021fa3014f4241b7.tar.xz |
Upstep Go dependencies (#340)
* Upstep Go dependencies
* tiny linter fix
* Tidy
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh')
-rw-r--r-- | vendor/golang.org/x/crypto/ssh/cipher.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index bddbde5db..f8bdf4984 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -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 |