File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,14 @@ const CIPHER_ORDER: &[cipher::Name] = &[
131131 cipher:: AES_128_CTR ,
132132] ;
133133
134+ // SHA-1 MAC variants excluded; see HMAC_ORDER for the full list including legacy algorithms.
135+ const SAFE_HMAC_ORDER : & [ mac:: Name ] = & [
136+ mac:: HMAC_SHA512_ETM ,
137+ mac:: HMAC_SHA256_ETM ,
138+ mac:: HMAC_SHA512 ,
139+ mac:: HMAC_SHA256 ,
140+ ] ;
141+
134142const HMAC_ORDER : & [ mac:: Name ] = & [
135143 mac:: HMAC_SHA512_ETM ,
136144 mac:: HMAC_SHA256_ETM ,
@@ -171,15 +179,15 @@ impl Preferred {
171179 Algorithm :: Rsa { hash : None } ,
172180 ] ) ,
173181 cipher : Cow :: Borrowed ( CIPHER_ORDER ) ,
174- mac : Cow :: Borrowed ( HMAC_ORDER ) ,
182+ mac : Cow :: Borrowed ( SAFE_HMAC_ORDER ) ,
175183 compression : Cow :: Borrowed ( COMPRESSION_ORDER ) ,
176184 } ;
177185
178186 pub const COMPRESSED : Preferred = Preferred {
179187 kex : Cow :: Borrowed ( SAFE_KEX_ORDER ) ,
180188 key : Preferred :: DEFAULT . key ,
181189 cipher : Cow :: Borrowed ( CIPHER_ORDER ) ,
182- mac : Cow :: Borrowed ( HMAC_ORDER ) ,
190+ mac : Cow :: Borrowed ( SAFE_HMAC_ORDER ) ,
183191 compression : Cow :: Borrowed ( COMPRESSION_ORDER ) ,
184192 } ;
185193}
You can’t perform that action at this time.
0 commit comments