File tree 2 files changed +10
-3
lines changed
openssl-sys/src/handwritten
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -702,6 +702,7 @@ pub struct X509_PURPOSE {
702
702
const_ptr_api ! {
703
703
extern "C" {
704
704
pub fn X509_PURPOSE_get_by_sname ( sname: #[ const_ptr_if( any( ossl110, libressl280) ) ] c_char) -> c_int;
705
+ pub fn X509_PURPOSE_get_id ( purpose: #[ const_ptr_if( any( ossl110, libressl280) ) ] X509_PURPOSE ) -> c_int;
705
706
}
706
707
}
707
708
extern "C" {
Original file line number Diff line number Diff line change @@ -2538,7 +2538,7 @@ impl X509PurposeRef {
2538
2538
unsafe {
2539
2539
let sname = CString :: new ( sname) . unwrap ( ) ;
2540
2540
cfg_if ! {
2541
- if #[ cfg( any( ossl110, libressl280) ) ] {
2541
+ if #[ cfg( any( ossl110, libressl280, boringssl ) ) ] {
2542
2542
let purpose = cvt_n( ffi:: X509_PURPOSE_get_by_sname ( sname. as_ptr( ) as * const _) ) ?;
2543
2543
} else {
2544
2544
let purpose = cvt_n( ffi:: X509_PURPOSE_get_by_sname ( sname. as_ptr( ) as * mut _) ) ?;
@@ -2569,8 +2569,14 @@ impl X509PurposeRef {
2569
2569
/// - `X509_PURPOSE_TIMESTAMP_SIGN`
2570
2570
pub fn purpose ( & self ) -> X509PurposeId {
2571
2571
unsafe {
2572
- let x509_purpose: * mut ffi:: X509_PURPOSE = self . as_ptr ( ) ;
2573
- X509PurposeId :: from_raw ( ( * x509_purpose) . purpose )
2572
+ cfg_if ! {
2573
+ if #[ cfg( any( ossl110, libressl280, boringssl) ) ] {
2574
+ let x509_purpose = self . as_ptr( ) as * const ffi:: X509_PURPOSE ;
2575
+ } else {
2576
+ let x509_purpose = self . as_ptr( ) as * mut ffi:: X509_PURPOSE ;
2577
+ }
2578
+ }
2579
+ X509PurposeId :: from_raw ( ffi:: X509_PURPOSE_get_id ( x509_purpose) )
2574
2580
}
2575
2581
}
2576
2582
}
You can’t perform that action at this time.
0 commit comments