Skip to content

Commit a53177e

Browse files
author
Georg Weisert
committed
add conditional compilation directives
1 parent fc468e5 commit a53177e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

openssl-sys/src/handwritten/x509.rs

+2
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,9 @@ extern "C" {
449449
#[cfg(ossl110)]
450450
pub fn X509_get0_extensions(req: *const X509) -> *const stack_st_X509_EXTENSION;
451451

452+
#[cfg(ossl110)]
452453
pub fn X509_CRL_get_version(crl: *const X509_CRL) -> c_long;
454+
453455
pub fn X509_CRL_set_version(crl: *mut X509_CRL, version: c_long) -> c_int;
454456
}
455457
const_ptr_api! {

openssl/src/x509/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,7 @@ impl X509Crl {
18761876
unsafe {
18771877
let crl = Self(cvt_p(ffi::X509_CRL_new())?);
18781878

1879+
#[cfg(ossl110)]
18791880
if issuer_cert.version() >= Self::X509_VERSION_3 {
18801881
#[cfg(any(ossl110, libressl251, boringssl))]
18811882
{
@@ -1926,6 +1927,9 @@ impl X509Crl {
19261927
}
19271928
}
19281929

1930+
/// Note that `0` return value stands for version 1, `1` for version 2.
1931+
#[cfg(ossl110)]
1932+
#[corresponds(X509_CRL_get_version)]
19291933
pub fn version(&self) -> i32 {
19301934
unsafe { ffi::X509_CRL_get_version(self.as_ptr()) as i32 }
19311935
}
@@ -2021,6 +2025,7 @@ impl X509Crl {
20212025
/// This is an internal function, therefore the caller is expected to ensure not to call this with a CRLv1
20222026
/// Set the crl_number extension's value.
20232027
/// If the extension is not present, it will be added.
2028+
#[cfg(ossl110)]
20242029
fn set_crl_number(&mut self, value: &BigNum) -> Result<(), ErrorStack> {
20252030
debug_assert_eq!(self.version(), Self::X509_CRL_VERSION_2);
20262031
unsafe {
@@ -2040,6 +2045,7 @@ impl X509Crl {
20402045
/// Increment the crl number (or try to add the extension if not present)
20412046
///
20422047
/// Returns the new crl number, unless self is a crlv1, which does not support extensions
2048+
#[cfg(ossl110)]
20432049
pub fn increment_crl_number(&mut self) -> Result<Option<BigNum>, ErrorStack> {
20442050
if self.version() == Self::X509_CRL_VERSION_2 {
20452051
let new_crl_number = if let Some(mut n) = self.read_crl_number()? {

0 commit comments

Comments
 (0)