ssh: export supported algorithms
Fixes golang/go#61537 Change-Id: If3478121e3ae445391e3faeceeb889d75e9e3214 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/531935 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Nicola Murino <nicola.murino@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
committed by
Gopher Robot
parent
9dbbcf002b
commit
ac58737d25
@@ -236,7 +236,7 @@ func recordingsClientConfig() *ssh.ClientConfig {
|
||||
config := clientConfig()
|
||||
config.SetDefaults()
|
||||
// Remove ML-KEM since it only works with Go 1.24.
|
||||
if config.KeyExchanges[0] == "mlkem768x25519-sha256" {
|
||||
if config.KeyExchanges[0] == ssh.KeyExchangeMLKEM768X25519 {
|
||||
config.KeyExchanges = config.KeyExchanges[1:]
|
||||
}
|
||||
config.Auth = []ssh.AuthMethod{
|
||||
@@ -352,7 +352,7 @@ func TestHostKeyCheck(t *testing.T) {
|
||||
|
||||
// change the keys.
|
||||
hostDB.keys[ssh.KeyAlgoRSA][25]++
|
||||
hostDB.keys[ssh.KeyAlgoDSA][25]++
|
||||
hostDB.keys[ssh.InsecureKeyAlgoDSA][25]++
|
||||
hostDB.keys[ssh.KeyAlgoECDSA256][25]++
|
||||
|
||||
test := clientTest{
|
||||
|
||||
@@ -219,7 +219,7 @@ func recordingsServerConfig() *ssh.ServerConfig {
|
||||
config.SetDefaults()
|
||||
// Remove ML-KEM since it only works with Go 1.24.
|
||||
config.SetDefaults()
|
||||
if config.KeyExchanges[0] == "mlkem768x25519-sha256" {
|
||||
if config.KeyExchanges[0] == ssh.KeyExchangeMLKEM768X25519 {
|
||||
config.KeyExchanges = config.KeyExchanges[1:]
|
||||
}
|
||||
config.AddHostKey(testSigners["rsa"])
|
||||
|
||||
@@ -128,7 +128,7 @@ func clientConfig() *ssh.ClientConfig {
|
||||
HostKeyCallback: hostKeyDB().Check,
|
||||
HostKeyAlgorithms: []string{ // by default, don't allow certs as this affects the hostKeyDB checker
|
||||
ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521,
|
||||
ssh.KeyAlgoRSA, ssh.KeyAlgoDSA,
|
||||
ssh.KeyAlgoRSA, ssh.InsecureKeyAlgoDSA,
|
||||
ssh.KeyAlgoED25519,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -224,8 +224,8 @@ func testOneCipher(t *testing.T, cipher string, cipherOrder []string) {
|
||||
}
|
||||
|
||||
var deprecatedCiphers = []string{
|
||||
"aes128-cbc", "3des-cbc",
|
||||
"arcfour128", "arcfour256",
|
||||
ssh.InsecureCipherAES128CBC, ssh.InsecureCipherTripleDESCBC,
|
||||
ssh.InsecureCipherRC4128, ssh.InsecureCipherRC4256,
|
||||
}
|
||||
|
||||
func TestCiphers(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user