Skip to content

Commit b763235

Browse files
committed
ssh: add support for [email protected]
1 parent 2c7772b commit b763235

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ssh/cipher.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ var cipherModes = map[string]*cipherMode{
116116

117117
// AEAD ciphers
118118
gcmCipherID: {16, 12, newGCMCipher},
119+
gcm256CipherID: {32, 12, newGCMCipher},
119120
chacha20Poly1305ID: {64, 0, newChaCha20Cipher},
120121

121122
// CBC mode is insecure and so is not included in the default config.

ssh/common.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727
// supportedCiphers lists ciphers we support but might not recommend.
2828
var supportedCiphers = []string{
2929
"aes128-ctr", "aes192-ctr", "aes256-ctr",
30-
30+
"[email protected]", gcm256CipherID,
3131
chacha20Poly1305ID,
3232
"arcfour256", "arcfour128", "arcfour",
3333
aes128cbcID,
@@ -36,7 +36,7 @@ var supportedCiphers = []string{
3636

3737
// preferredCiphers specifies the default preference for ciphers.
3838
var preferredCiphers = []string{
39-
39+
"[email protected]", gcm256CipherID,
4040
chacha20Poly1305ID,
4141
"aes128-ctr", "aes192-ctr", "aes256-ctr",
4242
}
@@ -153,7 +153,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
153153
// 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is
154154
// 128.
155155
switch a.Cipher {
156-
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID:
156+
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, gcm256CipherID, aes128cbcID:
157157
return 16 * (1 << 32)
158158

159159
}
@@ -164,6 +164,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
164164

165165
var aeadCiphers = map[string]bool{
166166
gcmCipherID: true,
167+
gcm256CipherID: true,
167168
chacha20Poly1305ID: true,
168169
}
169170

ssh/transport.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const debugTransport = false
1818

1919
const (
2020
gcmCipherID = "[email protected]"
21+
gcm256CipherID = "[email protected]"
2122
aes128cbcID = "aes128-cbc"
2223
tripledescbcID = "3des-cbc"
2324
)

0 commit comments

Comments
 (0)