diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-12-09 12:32:35 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-12-09 13:28:28 +0100 |
commit | 88f43e115383c89fb83714e5dd6fbd2f9df16047 (patch) | |
tree | 865b76d3e02ac77b69b80eeac321f0105e1ff3a4 /openpgp-ffi/src | |
parent | fe8093bc1aef8c6a79fd1dc76f5cc857eae05d50 (diff) |
openpgp: Return result from Cert::alive, remove Cert::expired.
- See #371.
Diffstat (limited to 'openpgp-ffi/src')
-rw-r--r-- | openpgp-ffi/src/cert.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs index 00e7b3b4..c85be4f6 100644 --- a/openpgp-ffi/src/cert.rs +++ b/openpgp-ffi/src/cert.rs @@ -315,21 +315,14 @@ fn pgp_cert_revoke_in_place(errp: Option<&mut *mut crate::error::Error>, cert.revoke_in_place(signer.as_mut(), code, reason).move_into_raw(errp) } -/// Returns whether the Cert has expired. -/// -/// If `when` is 0, then the current time is used. -#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" -fn pgp_cert_expired(cert: *const Cert, when: time_t) -> c_int { - cert.ref_raw().expired(maybe_time(when)) as c_int -} - /// Returns whether the Cert is alive at the specified time. /// /// If `when` is 0, then the current time is used. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" -fn pgp_cert_alive(cert: *const Cert, when: time_t) - -> c_int { - cert.ref_raw().alive(maybe_time(when)) as c_int +fn pgp_cert_alive(errp: Option<&mut *mut crate::error::Error>, + cert: *const Cert, when: time_t) -> Status { + ffi_make_fry_from_errp!(errp); + ffi_try_status!(cert.ref_raw().alive(maybe_time(when))) } /// Changes the Cert's expiration. |