summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/src/parse/stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp-ffi/src/parse/stream.rs')
-rw-r--r--openpgp-ffi/src/parse/stream.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/openpgp-ffi/src/parse/stream.rs b/openpgp-ffi/src/parse/stream.rs
index 9148b79c..d46f9042 100644
--- a/openpgp-ffi/src/parse/stream.rs
+++ b/openpgp-ffi/src/parse/stream.rs
@@ -172,6 +172,7 @@ fn pgp_verification_result_variant(result: *const VerificationResult)
GoodChecksum(..) => 1,
MissingKey(_) => 2,
BadChecksum(_) => 3,
+ NotAlive(_) => 4,
}
}
@@ -220,6 +221,29 @@ fn pgp_verification_result_good_checksum<'a>(
}
}
+/// Decomposes a `VerificationResult::NotAlive`.
+///
+/// Returns `true` iff the given value is a
+/// `VerificationResult::NotAlive`, and returns the variant's members
+/// in `sig_r` and the like iff `sig_r != NULL`.
+#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C"
+fn pgp_verification_result_not_alive<'a>(
+ result: *const VerificationResult<'a>,
+ sig_r: Maybe<*mut Signature>)
+ -> bool
+{
+ use self::stream::VerificationResult::*;
+ if let NotAlive(ref sig) = result.ref_raw()
+ {
+ if let Some(mut p) = sig_r {
+ *unsafe { p.as_mut() } = sig.move_into_raw();
+ }
+ true
+ } else {
+ false
+ }
+}
+
/// Decomposes a `VerificationResult::MissingKey`.
///
/// Returns `true` iff the given value is a