diff --git a/openssl-sys/src/handwritten/x509.rs b/openssl-sys/src/handwritten/x509.rs index 2c0dfca65..4ec019f39 100644 --- a/openssl-sys/src/handwritten/x509.rs +++ b/openssl-sys/src/handwritten/x509.rs @@ -449,7 +449,7 @@ extern "C" { #[cfg(ossl110)] pub fn X509_get0_extensions(req: *const X509) -> *const stack_st_X509_EXTENSION; - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] pub fn X509_CRL_get_version(crl: *const X509_CRL) -> c_long; pub fn X509_CRL_set_version(crl: *mut X509_CRL, version: c_long) -> c_int; diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index ed67138ef..09eb8c51a 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -621,7 +621,7 @@ impl X509Ref { /// /// Note that `0` return value stands for version 1, `1` for version 2 and so on. #[corresponds(X509_get_version)] - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] #[allow(clippy::unnecessary_cast)] pub fn version(&self) -> i32 { unsafe { ffi::X509_get_version(self.as_ptr()) as i32 } @@ -1868,9 +1868,9 @@ impl X509Crl { ffi::d2i_X509_CRL } - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] const X509_VERSION_3: i32 = 2; - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] const X509_CRL_VERSION_2: i32 = 1; // if not cfg(ossl110) issuer_cert is unused @@ -1879,7 +1879,7 @@ impl X509Crl { unsafe { let crl = Self(cvt_p(ffi::X509_CRL_new())?); - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] if issuer_cert.version() >= Self::X509_VERSION_3 { use crate::x509::extension::AuthorityKeyIdentifier; @@ -1933,7 +1933,7 @@ impl X509Crl { } /// Note that `0` return value stands for version 1, `1` for version 2. - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] #[corresponds(X509_CRL_get_version)] pub fn version(&self) -> i32 { unsafe { ffi::X509_CRL_get_version(self.as_ptr()) as i32 } @@ -2030,7 +2030,7 @@ impl X509Crl { /// This is an internal function, therefore the caller is expected to ensure not to call this with a CRLv1 /// Set the crl_number extension's value. /// If the extension is not present, it will be added. - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] fn set_crl_number(&mut self, value: &BigNum) -> Result<(), ErrorStack> { debug_assert_eq!(self.version(), Self::X509_CRL_VERSION_2); unsafe { @@ -2050,7 +2050,7 @@ impl X509Crl { /// Increment the crl number (or try to add the extension if not present) /// /// Returns the new crl number, unless self is a crlv1, which does not support extensions - #[cfg(ossl110)] + #[cfg(any(ossl110, libressl281))] pub fn increment_crl_number(&mut self) -> Result, ErrorStack> { if self.version() == Self::X509_CRL_VERSION_2 { let new_crl_number = if let Some(mut n) = self.read_crl_number()? {