@@ -52,11 +52,10 @@ pub struct Preferred {
5252 pub compression : & ' static [ & ' static str ] ,
5353}
5454
55- const KEX_ORDER : & [ kex:: Name ] = & [
55+ const SAFE_KEX_ORDER : & [ kex:: Name ] = & [
5656 kex:: CURVE25519 ,
57+ kex:: CURVE25519_PRE_RFC_8731 ,
5758 kex:: DH_G14_SHA256 ,
58- kex:: DH_G14_SHA1 ,
59- kex:: DH_G1_SHA1 ,
6059 kex:: EXTENSION_SUPPORT_AS_CLIENT ,
6160 kex:: EXTENSION_SUPPORT_AS_SERVER ,
6261] ;
@@ -82,7 +81,7 @@ const HMAC_ORDER: &[mac::Name] = &[
8281impl Preferred {
8382 #[ cfg( feature = "openssl" ) ]
8483 pub const DEFAULT : Preferred = Preferred {
85- kex : & [ kex :: CURVE25519 , kex :: DH_G14_SHA256 ] ,
84+ kex : SAFE_KEX_ORDER ,
8685 key : & [ key:: ED25519 , key:: RSA_SHA2_256 , key:: RSA_SHA2_512 ] ,
8786 cipher : CIPHER_ORDER ,
8887 mac : HMAC_ORDER ,
@@ -91,15 +90,15 @@ impl Preferred {
9190
9291 #[ cfg( not( feature = "openssl" ) ) ]
9392 pub const DEFAULT : Preferred = Preferred {
94- kex : KEX_ORDER ,
93+ kex : SAFE_KEX_ORDER ,
9594 key : & [ key:: ED25519 ] ,
9695 cipher : CIPHER_ORDER ,
9796 mac : HMAC_ORDER ,
9897 compression : & [ "none" , "zlib" , "zlib@openssh.com" ] ,
9998 } ;
10099
101100 pub const COMPRESSED : Preferred = Preferred {
102- kex : KEX_ORDER ,
101+ kex : SAFE_KEX_ORDER ,
103102 key : & [ key:: ED25519 , key:: RSA_SHA2_256 , key:: RSA_SHA2_512 ] ,
104103 cipher : CIPHER_ORDER ,
105104 mac : HMAC_ORDER ,
0 commit comments