@@ -922,6 +922,13 @@ entry! {
922922pub type SSL_client_hello_cb_func =
923923 Option < unsafe extern "C" fn ( _ssl : * mut SSL , _al : * mut c_int , _arg : * mut c_void ) -> c_int > ;
924924
925+ entry ! {
926+ pub fn _SSL_CTX_set_security_level( ctx: * mut SSL_CTX , level: c_int) {
927+ let _null_check = try_clone_arc!( ctx) ;
928+ security_level_diagnostic( level)
929+ }
930+ }
931+
925932impl Castable for SSL_CTX {
926933 type Ownership = OwnershipArc ;
927934 type RustType = NotThreadSafe < Self > ;
@@ -1136,6 +1143,27 @@ entry! {
11361143 }
11371144}
11381145
1146+ entry ! {
1147+ pub fn _SSL_set_security_level( ssl: * mut SSL , level: c_int) {
1148+ let _null_check = try_clone_arc!( ssl) ;
1149+ security_level_diagnostic( level)
1150+ }
1151+ }
1152+
1153+ fn security_level_diagnostic ( level : c_int ) {
1154+ match level {
1155+ // this is the rustls default
1156+ 2 => { }
1157+ // all of these are possible with sufficient CryptoProvider plumbing. the signature verification
1158+ // facets would be the most complex to arrange.
1159+ 3 => log:: warn!( "security level for 128-bit security requested but NYI" ) ,
1160+ 4 => log:: warn!( "security level for 192-bit security requested but NYI" ) ,
1161+ 5 => log:: warn!( "security level for 256-bit security requested but NYI" ) ,
1162+ // others (lower, or negative, or huge are not reasonable)
1163+ _ => log:: warn!( "security level {level:?} not supported" ) ,
1164+ }
1165+ }
1166+
11391167entry ! {
11401168 pub fn _SSL_set_connect_state( ssl: * mut SSL ) {
11411169 try_clone_arc!( ssl) . get_mut( ) . set_client_mode( )
0 commit comments