diff options
| author | Rob Picard <rob.picard@goteleport.com> | 2026-03-12 11:17:52 -0600 |
|---|---|---|
| committer | Nicola Murino <nicola.murino@gmail.com> | 2026-03-20 08:28:06 -0700 |
| commit | 81c6cb34a8fc386ed53293cd79e3c0c232ee7366 (patch) | |
| tree | b68cf9aed3339baaede7e9a3cd98e7f97bcf943c | |
| parent | 982eaa62dfb7273603b97fc1835561450096f3bd (diff) | |
| download | go-x-crypto-81c6cb34a8fc386ed53293cd79e3c0c232ee7366.tar.xz | |
ssh: swap cbcMinPaddingSize to cbcMinPacketSize to get encLength
The existing code uses cbcMinPaddingSize incorrectly. That value is
also used in the first parameter of the max call, meaning it will
never be used.
Fixes golang/go#78062
Change-Id: I4243ab668168313919df33d78c6965e9eff0e934
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/754780
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
| -rw-r--r-- | ssh/cipher.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ssh/cipher.go b/ssh/cipher.go index 7554ed5..ad2b370 100644 --- a/ssh/cipher.go +++ b/ssh/cipher.go @@ -586,7 +586,7 @@ func (c *cbcCipher) writeCipherPacket(seqNum uint32, w io.Writer, rand io.Reader // Length of encrypted portion of the packet (header, payload, padding). // Enforce minimum padding and packet size. - encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize) + encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPacketSize) // Enforce block size. encLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize |
