forked from golang/crypto
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ssh: add more kex and remove sha1 from preferred mac/kex
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,8 @@ var supportedKexAlgos = []string{ | |
// P384 and P521 are not constant-time yet, but since we don't | ||
// reuse ephemeral keys, using them for ECDH should be OK. | ||
kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, | ||
kexAlgoDH14SHA256, kexAlgoDH14SHA1, kexAlgoDH1SHA1, | ||
kexAlgoDH14SHA256, kexAlgoDH16SHA512, kexAlgoDH18SHA512, | ||
kexAlgoDH14SHA1, kexAlgoDH1SHA1, | ||
} | ||
|
||
// serverForbiddenKexAlgos contains key exchange algorithms, that are forbidden | ||
|
@@ -63,7 +64,7 @@ var serverForbiddenKexAlgos = map[string]struct{}{ | |
var preferredKexAlgos = []string{ | ||
kexAlgoCurve25519SHA256, kexAlgoCurve25519SHA256LibSSH, | ||
kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, | ||
kexAlgoDH14SHA256, kexAlgoDH14SHA1, | ||
kexAlgoDH14SHA256, | ||
} | ||
|
||
// supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods | ||
|
@@ -88,6 +89,10 @@ var supportedMACs = []string{ | |
"hmac-sha1", "hmac-sha1-96", | ||
} | ||
|
||
var preferredMACs = []string{ | ||
"[email protected]", "hmac-sha2-256", | ||
} | ||
|
||
var supportedCompressions = []string{compressionNone} | ||
|
||
// hashFuncs keeps the mapping of supported signature algorithms to their | ||
|
@@ -285,7 +290,7 @@ func (c *Config) SetDefaults() { | |
} | ||
|
||
if c.MACs == nil { | ||
c.MACs = supportedMACs | ||
c.MACs = preferredMACs | ||
} | ||
|
||
if c.RekeyThreshold == 0 { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters