Skip to content

Commit

Permalink
extend availability of X509_CRL_get_version and related function to l…
Browse files Browse the repository at this point in the history
…ibressl 2.8.1
  • Loading branch information
Georg Weisert committed Mar 3, 2024
1 parent 3e4fbdb commit 974f466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/src/handwritten/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 {
Expand All @@ -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<Option<BigNum>, ErrorStack> {
if self.version() == Self::X509_CRL_VERSION_2 {
let new_crl_number = if let Some(mut n) = self.read_crl_number()? {
Expand Down

0 comments on commit 974f466

Please sign in to comment.