summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/src
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-09-17 17:40:23 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-09-17 17:44:38 +0200
commitc2c61f44ac35e16051b2b6a3f0569265abdf15c8 (patch)
treea84fd2951bd2829041f841e19d0222708405881e /openpgp-ffi/src
parent1324bc3db18dbf9e27db2903515ac6c8f5b30704 (diff)
openpgp: Rename TPK::revocation_status to TPK::revoked.
- Combine TPK::revocation_status and TPK::revocation_status_at; only keep the version with the optional time parameter. - Rename TPK::revocation_status to TPK::revoked to match KeyBinding::revoked, UserIDBinding::revoked, and UserAttributeBinding::revoked. - Do the same for the C API.
Diffstat (limited to 'openpgp-ffi/src')
-rw-r--r--openpgp-ffi/src/tpk.rs23
1 files changed, 7 insertions, 16 deletions
diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs
index 80801789..48169a98 100644
--- a/openpgp-ffi/src/tpk.rs
+++ b/openpgp-ffi/src/tpk.rs
@@ -158,8 +158,11 @@ fn pgp_tpk_primary_key(tpk: *const TPK) -> *const Key {
/// Note: this only returns whether the TPK has been revoked, and does
/// not reflect whether an individual user id, user attribute or
/// subkey has been revoked.
+///
+/// If `when` is 0, then returns the TPK's revocation status as of the
+/// time of the call.
#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C"
-fn pgp_tpk_revocation_status_at(tpk: *const TPK, when: time_t)
+fn pgp_tpk_revoked(tpk: *const TPK, when: time_t)
-> *mut RevocationStatus<'static>
{
let when = when as i64;
@@ -169,19 +172,7 @@ fn pgp_tpk_revocation_status_at(tpk: *const TPK, when: time_t)
Some(time::at(time::Timespec::new(when, 0)))
};
- tpk.ref_raw().revocation_status_at(when).move_into_raw()
-}
-
-/// Returns the TPK's current revocation status.
-///
-/// Note: this only returns whether the TPK has been revoked, and does
-/// not reflect whether an individual user id, user attribute or
-/// subkey has been revoked.
-#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C"
-fn pgp_tpk_revocation_status(tpk: *const TPK)
- -> *mut RevocationStatus<'static>
-{
- tpk.ref_raw().revocation_status().move_into_raw()
+ tpk.ref_raw().revoked(when).move_into_raw()
}
fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation {
@@ -237,7 +228,7 @@ fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation {
/// tpk = pgp_tpk_merge_packets (NULL, tpk, &packet, 1);
/// assert (tpk);
///
-/// pgp_revocation_status_t rs = pgp_tpk_revocation_status (tpk);
+/// pgp_revocation_status_t rs = pgp_tpk_revoked (tpk, 0);
/// assert (pgp_revocation_status_variant (rs) == PGP_REVOCATION_STATUS_REVOKED);
/// pgp_revocation_status_free (rs);
///
@@ -301,7 +292,7 @@ fn pgp_tpk_revoke(errp: Option<&mut *mut crate::error::Error>,
/// pgp_signer_free (primary_signer);
/// pgp_key_pair_free (primary_keypair);
///
-/// pgp_revocation_status_t rs = pgp_tpk_revocation_status (tpk);
+/// pgp_revocation_status_t rs = pgp_tpk_revoked (tpk, 0);
/// assert (pgp_revocation_status_variant (rs) == PGP_REVOCATION_STATUS_REVOKED);
/// pgp_revocation_status_free (rs);
///