Skip to content

Commit

Permalink
ssh: add support for [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
drakkan committed Mar 14, 2020
1 parent f7b0055 commit 5ce5bcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ssh/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ var cipherModes = map[string]*cipherMode{

// AEAD ciphers
gcmCipherID: {16, 12, newGCMCipher},
gcm256CipherID: {32, 12, newGCMCipher},
chacha20Poly1305ID: {64, 0, newChaCha20Cipher},

// CBC mode is insecure and so is not included in the default config.
Expand Down
6 changes: 3 additions & 3 deletions ssh/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
// supportedCiphers lists ciphers we support but might not recommend.
var supportedCiphers = []string{
"aes128-ctr", "aes192-ctr", "aes256-ctr",
"[email protected]",
gcmCipherID, gcm256CipherID,
chacha20Poly1305ID,
"arcfour256", "arcfour128", "arcfour",
aes128cbcID,
Expand All @@ -36,7 +36,7 @@ var supportedCiphers = []string{

// preferredCiphers specifies the default preference for ciphers.
var preferredCiphers = []string{
"[email protected]",
gcmCipherID, gcm256CipherID,
chacha20Poly1305ID,
"aes128-ctr", "aes192-ctr", "aes256-ctr",
}
Expand Down Expand Up @@ -137,7 +137,7 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
// 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is
// 128.
switch a.Cipher {
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID:
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, gcm256CipherID, aes128cbcID:
return 16 * (1 << 32)

}
Expand Down
1 change: 1 addition & 0 deletions ssh/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const debugTransport = false

const (
gcmCipherID = "[email protected]"
gcm256CipherID = "[email protected]"
aes128cbcID = "aes128-cbc"
tripledescbcID = "3des-cbc"
)
Expand Down

0 comments on commit 5ce5bcd

Please sign in to comment.