File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 485
485
| ` SSL_test_functions ` [ ^ unit_test ] | | | |
486
486
| ` SSL_trace ` [ ^ ssl_trace ] | | | |
487
487
| ` SSL_up_ref ` | | | :white_check_mark : |
488
- | ` SSL_use_PrivateKey ` | | :white_check_mark : | |
488
+ | ` SSL_use_PrivateKey ` | | :white_check_mark : | : white_check_mark : |
489
489
| ` SSL_use_PrivateKey_ASN1 ` | | | |
490
490
| ` SSL_use_PrivateKey_file ` | | | |
491
491
| ` SSL_use_RSAPrivateKey ` [ ^ deprecatedin_3_0 ] | | | |
492
492
| ` SSL_use_RSAPrivateKey_ASN1 ` [ ^ deprecatedin_3_0 ] | | | |
493
493
| ` SSL_use_RSAPrivateKey_file ` [ ^ deprecatedin_3_0 ] | | | |
494
494
| ` SSL_use_cert_and_key ` | | | |
495
- | ` SSL_use_certificate ` | | :white_check_mark : | |
495
+ | ` SSL_use_certificate ` | | :white_check_mark : | : white_check_mark : |
496
496
| ` SSL_use_certificate_ASN1 ` | | | |
497
497
| ` SSL_use_certificate_chain_file ` | | | |
498
498
| ` SSL_use_certificate_file ` | | | |
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ const ENTRYPOINTS: &[&str] = &[
151
151
"SSL_set_SSL_CTX" ,
152
152
"SSL_shutdown" ,
153
153
"SSL_up_ref" ,
154
+ "SSL_use_certificate" ,
155
+ "SSL_use_PrivateKey" ,
154
156
"SSL_want" ,
155
157
"SSL_write" ,
156
158
"TLS_client_method" ,
Original file line number Diff line number Diff line change @@ -1114,6 +1114,49 @@ entry! {
1114
1114
}
1115
1115
}
1116
1116
1117
+ entry ! {
1118
+ pub fn _SSL_use_certificate( ssl: * mut SSL , x: * mut X509 ) -> c_int {
1119
+ let ssl = try_clone_arc!( ssl) ;
1120
+
1121
+ if x. is_null( ) {
1122
+ return Error :: null_pointer( ) . raise( ) . into( ) ;
1123
+ }
1124
+
1125
+ let x509 = OwnedX509 :: new_incref( x) ;
1126
+ let ee = CertificateDer :: from( x509. der_bytes( ) ) ;
1127
+
1128
+ match ssl
1129
+ . lock( )
1130
+ . map_err( |_| Error :: cannot_lock( ) )
1131
+ . map( |mut ssl| ssl. stage_certificate_end( ee) )
1132
+ {
1133
+ Err ( e) => e. raise( ) . into( ) ,
1134
+ Ok ( ( ) ) => C_INT_SUCCESS ,
1135
+ }
1136
+ }
1137
+ }
1138
+
1139
+ entry ! {
1140
+ pub fn _SSL_use_PrivateKey( ssl: * mut SSL , pkey: * mut EVP_PKEY ) -> c_int {
1141
+ let ssl = try_clone_arc!( ssl) ;
1142
+
1143
+ if pkey. is_null( ) {
1144
+ return Error :: null_pointer( ) . raise( ) . into( ) ;
1145
+ }
1146
+
1147
+ let pkey = EvpPkey :: new_incref( pkey) ;
1148
+
1149
+ match ssl
1150
+ . lock( )
1151
+ . map_err( |_| Error :: cannot_lock( ) )
1152
+ . and_then( |mut ssl| ssl. commit_private_key( pkey) )
1153
+ {
1154
+ Err ( e) => e. raise( ) . into( ) ,
1155
+ Ok ( ( ) ) => C_INT_SUCCESS ,
1156
+ }
1157
+ }
1158
+ }
1159
+
1117
1160
impl Castable for SSL {
1118
1161
type Ownership = OwnershipArc ;
1119
1162
type RustType = Mutex < SSL > ;
You can’t perform that action at this time.
0 commit comments