Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sfackler/rust-openssl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 923783cb28683fcbb89bd43154afa127eda58359
Choose a base ref
..
head repository: sfackler/rust-openssl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b44bcc5fd1ea872f553e3149e4522bd736e70e43
Choose a head ref
Showing with 26 additions and 18 deletions.
  1. +26 −18 openssl/src/x509/mod.rs
44 changes: 26 additions & 18 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
@@ -1866,9 +1866,9 @@ impl X509Crl {

cfg_if!(
if #[cfg(any(ossl110, libressl270))] {
unsafe { cvt(ffi::X509_CRL_set1_lastUpdate(crl, Asn1Time::now()?.as_ptr())).map(|_| ()) }
cvt(ffi::X509_CRL_set1_lastUpdate(crl, Asn1Time::now()?.as_ptr())).map(|_| ())?
} else {
unsafe { cvt(ffi::X509_CRL_set_lastUpdate(crl, Asn1Time::now()?.as_ptr())).map(|_| ()) }
cvt(ffi::X509_CRL_set_lastUpdate(crl, Asn1Time::now()?.as_ptr())).map(|_| ())?
}
);

@@ -1880,35 +1880,43 @@ impl X509Crl {
pub fn set_last_update(&mut self, seconds_from_now: Option<i32>) -> Result<(), ErrorStack> {
let time = Asn1Time::seconds_from_now(seconds_from_now.unwrap_or(0) as c_long)?;
cfg_if!(
if #[cfg(any(ossl110, libressl270))] {
unsafe { cvt(ffi::X509_CRL_set1_lastUpdate(self.as_ptr(), time.as_ptr())).map(|_| ()) }
if #[cfg(any(ossl110, libressl270))] {
unsafe {
cvt(ffi::X509_CRL_set1_lastUpdate(self.as_ptr(), time.as_ptr())).map(|_| ())?
};
} else {
unsafe { cvt(ffi::X509_CRL_set_lastUpdate(self.as_ptr(), time.as_ptr())).map(|_| ()) }
unsafe {
cvt(ffi::X509_CRL_set_lastUpdate(self.as_ptr(), time.as_ptr())).map(|_| ())?
};
}
)
);

Ok(())
}

// Note: u32 seconds is more than enough for this;
pub fn set_next_update_from_now(&mut self, seconds_from_now: u32) -> Result<(), ErrorStack> {
cfg_if!(
if #[cfg(any(ossl110, libressl270))] {
if #[cfg(any(ossl110, libressl270))] {
unsafe {
cvt(ffi::X509_CRL_set1_nextUpdate(
self.as_ptr(),
Asn1Time::seconds_from_now(seconds_from_now as c_long)?.as_ptr(),
))
.map(|_| ())
}
} else {
unsafe {
cvt(ffi::X509_CRL_set_nextUpdate(
self.as_ptr(),
Asn1Time::seconds_from_now(seconds_from_now as c_long)?.as_ptr(),
))
.map(|_| ())
}
.map(|_| ())?;
}
)
} else {
unsafe {
cvt(ffi::X509_CRL_set_nextUpdate(
self.as_ptr(),
Asn1Time::seconds_from_now(seconds_from_now as c_long)?.as_ptr(),
))
.map(|_| ())?;
}
}
);

Ok(())
}

pub fn entry_count(&mut self) -> usize {