Skip to content

Commit 9a2f78f

Browse files
committed
fix older ssl
1 parent 8b73804 commit 9a2f78f

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

openssl-sys/src/handwritten/cms.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ extern "C" {
6363
flags: c_uint,
6464
) -> c_int;
6565

66-
cfg_if!(
67-
if #[cfg(any(ossl101, ossl102))] {
68-
pub fn CMS_get0_type(cms: *mut CMS_ContentInfo) -> *const ASN1_OBJECT;
69-
} else {
66+
}
67+
68+
cfg_if! {
69+
if #[cfg(ossl111)] {
70+
extern "C" {
7071
pub fn CMS_get0_type(cms: *const CMS_ContentInfo) -> *const ASN1_OBJECT;
7172
}
72-
);
73+
} else {
74+
extern "C" {
75+
pub fn CMS_get0_type(cms: *mut CMS_ContentInfo) -> *const ASN1_OBJECT;
76+
}
77+
}
7378
}

openssl/src/cms.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crate::util::ForeignTypeRefExt;
2020
use crate::x509::{store::X509StoreRef, X509Ref, X509};
2121
use crate::{cvt, cvt_p};
2222
use openssl_macros::corresponds;
23-
use cfg_if::cfg_if;
2423

2524
bitflags! {
2625
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
@@ -282,14 +281,8 @@ impl CmsContentInfo {
282281
#[corresponds(CMS_get0_type)]
283282
pub fn get_type(&self) -> &Asn1ObjectRef {
284283
unsafe {
285-
cfg_if!(
286-
if #[cfg(any(ossl101, ossl102))] {
287-
let asn1_type = ffi::CMS_get0_type(self.as_ptr());
288-
} else {
289-
let asn1_type = ffi::CMS_get0_type(self.as_ptr() as *const _);
290-
}
291-
);
292-
284+
let asn1_type = ffi::CMS_get0_type(self.as_ptr());
285+
293286
Asn1ObjectRef::from_const_ptr(asn1_type)
294287
}
295288
}

0 commit comments

Comments
 (0)