@@ -747,16 +747,12 @@ impl SslCurve {
747747 }
748748 }
749749
750- // We need to allow dead_code here because `SslRef::set_curves` is conditionally compiled
751- // against the absence of the `kx-safe-default` feature and thus this function is never used.
752- //
753750 // **NOTE**: This function only exists because the version of boringssl we currently use does
754751 // not expose SSL_CTX_set1_group_ids. Because `SslRef::curve()` returns the public SSL_GROUP id
755752 // as opposed to the internal NID, but `SslContextBuilder::set_curves()` requires the internal
756753 // NID, we need this mapping in place to avoid breaking changes to the public API. Once the
757754 // underlying boringssl version is upgraded, this should be removed in favor of the new
758755 // SSL_CTX_set1_group_ids API.
759- #[ allow( dead_code) ]
760756 pub fn nid ( & self ) -> Option < SslCurveNid > {
761757 match self . 0 {
762758 ffi:: SSL_GROUP_SECP224R1 => Some ( ffi:: NID_secp224r1 ) ,
@@ -2017,11 +2013,6 @@ impl SslContextBuilder {
20172013 }
20182014
20192015 /// Sets the context's supported curves.
2020- //
2021- // If the "kx-*" flags are used to set key exchange preference, then don't allow the user to
2022- // set them here. This ensures we don't override the user's preference without telling them:
2023- // when the flags are used, the preferences are set just before connecting or accepting.
2024- #[ cfg( not( feature = "kx-safe-default" ) ) ]
20252016 #[ corresponds( SSL_CTX_set1_curves_list ) ]
20262017 pub fn set_curves_list ( & mut self , curves : & str ) -> Result < ( ) , ErrorStack > {
20272018 let curves = CString :: new ( curves) . map_err ( ErrorStack :: internal_error) ?;
@@ -2035,12 +2026,7 @@ impl SslContextBuilder {
20352026 }
20362027
20372028 /// Sets the context's supported curves.
2038- //
2039- // If the "kx-*" flags are used to set key exchange preference, then don't allow the user to
2040- // set them here. This ensures we don't override the user's preference without telling them:
2041- // when the flags are used, the preferences are set just before connecting or accepting.
20422029 #[ corresponds( SSL_CTX_set1_curves ) ]
2043- #[ cfg( not( feature = "kx-safe-default" ) ) ]
20442030 pub fn set_curves ( & mut self , curves : & [ SslCurve ] ) -> Result < ( ) , ErrorStack > {
20452031 let curves: Vec < i32 > = curves
20462032 . iter ( )
@@ -2915,40 +2901,6 @@ impl SslRef {
29152901 }
29162902 }
29172903
2918- #[ cfg( feature = "kx-safe-default" ) ]
2919- fn client_set_default_curves_list ( & mut self ) {
2920- let curves = if cfg ! ( feature = "kx-client-pq-preferred" ) {
2921- if cfg ! ( feature = "kx-client-nist-required" ) {
2922- "P256Kyber768Draft00:P-256:P-384:P-521"
2923- } else {
2924- "X25519MLKEM768:X25519Kyber768Draft00:X25519:P256Kyber768Draft00:P-256:P-384:P-521"
2925- }
2926- } else if cfg ! ( feature = "kx-client-pq-supported" ) {
2927- if cfg ! ( feature = "kx-client-nist-required" ) {
2928- "P-256:P-384:P-521:P256Kyber768Draft00"
2929- } else {
2930- "X25519:P-256:P-384:P-521:X25519MLKEM768:X25519Kyber768Draft00:P256Kyber768Draft00"
2931- }
2932- } else {
2933- if cfg ! ( feature = "kx-client-nist-required" ) {
2934- "P-256:P-384:P-521"
2935- } else {
2936- "X25519:P-256:P-384:P-521"
2937- }
2938- } ;
2939-
2940- self . set_curves_list ( curves)
2941- . expect ( "invalid default client curves list" ) ;
2942- }
2943-
2944- #[ cfg( feature = "kx-safe-default" ) ]
2945- fn server_set_default_curves_list ( & mut self ) {
2946- self . set_curves_list (
2947- "X25519MLKEM768:X25519Kyber768Draft00:P256Kyber768Draft00:X25519:P-256:P-384" ,
2948- )
2949- . expect ( "invalid default server curves list" ) ;
2950- }
2951-
29522904 /// Returns the [`SslCurve`] used for this `SslRef`.
29532905 #[ corresponds( SSL_get_curve_id ) ]
29542906 #[ must_use]
@@ -4341,9 +4293,6 @@ where
43414293 pub fn setup_connect ( mut self ) -> MidHandshakeSslStream < S > {
43424294 self . set_connect_state ( ) ;
43434295
4344- #[ cfg( feature = "kx-safe-default" ) ]
4345- self . inner . ssl . client_set_default_curves_list ( ) ;
4346-
43474296 MidHandshakeSslStream {
43484297 stream : self . inner ,
43494298 error : Error {
@@ -4373,9 +4322,6 @@ where
43734322 pub fn setup_accept ( mut self ) -> MidHandshakeSslStream < S > {
43744323 self . set_accept_state ( ) ;
43754324
4376- #[ cfg( feature = "kx-safe-default" ) ]
4377- self . inner . ssl . server_set_default_curves_list ( ) ;
4378-
43794325 MidHandshakeSslStream {
43804326 stream : self . inner ,
43814327 error : Error {
0 commit comments