Skip to content

Commit 460b96d

Browse files
committed
ssh: add support for [email protected]
1 parent a9f661c commit 460b96d

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
@@ -115,6 +115,7 @@ var cipherModes = map[string]*cipherMode{
115115

116116
// AEAD ciphers
117117
gcmCipherID: {16, 12, newGCMCipher},
118+
gcm256CipherID: {32, 12, newGCMCipher},
118119
chacha20Poly1305ID: {64, 0, newChaCha20Cipher},
119120

120121
// 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
@@ -28,7 +28,7 @@ const (
2828
// supportedCiphers lists ciphers we support but might not recommend.
2929
var supportedCiphers = []string{
3030
"aes128-ctr", "aes192-ctr", "aes256-ctr",
31-
31+
"[email protected]", gcm256CipherID,
3232
chacha20Poly1305ID,
3333
"arcfour256", "arcfour128", "arcfour",
3434
aes128cbcID,
@@ -37,7 +37,7 @@ var supportedCiphers = []string{
3737

3838
// preferredCiphers specifies the default preference for ciphers.
3939
var preferredCiphers = []string{
40-
40+
"[email protected]", gcm256CipherID,
4141
chacha20Poly1305ID,
4242
"aes128-ctr", "aes192-ctr", "aes256-ctr",
4343
}
@@ -168,7 +168,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
168168
// 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is
169169
// 128.
170170
switch a.Cipher {
171-
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID:
171+
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, gcm256CipherID, aes128cbcID:
172172
return 16 * (1 << 32)
173173

174174
}
@@ -179,6 +179,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
179179

180180
var aeadCiphers = map[string]bool{
181181
gcmCipherID: true,
182+
gcm256CipherID: true,
182183
chacha20Poly1305ID: true,
183184
}
184185

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)