diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-01-13 22:36:54 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-01-14 10:34:53 +0100 |
commit | 8e89a8f63a5aa6a0f51ed595a34ee20cc2f8bcfa (patch) | |
tree | 4bef0d73890bc45f846a08b3c31f36b00b7e2ba6 /openpgp-ffi/src/error.rs | |
parent | 33ab7dd6d9b7f92afab67d8e00902a71a677c341 (diff) |
openpgp: Rework stream verification logic.
- Select keys only when verifying the signatures: the relevant keys
depend on the timestamp in the signature, and different signatures
may have different time stamps.
- If the signature doens't have a Signature Creation Time stamp,
return that the signature is invalid.
Diffstat (limited to 'openpgp-ffi/src/error.rs')
-rw-r--r-- | openpgp-ffi/src/error.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp-ffi/src/error.rs b/openpgp-ffi/src/error.rs index 43b2b63d..b26610a5 100644 --- a/openpgp-ffi/src/error.rs +++ b/openpgp-ffi/src/error.rs @@ -156,6 +156,9 @@ pub enum Status { /// No binding signature. NoBindingSignature = -32, + + /// Invalid key. + InvalidKey = -33, } /// Returns the error message. @@ -199,6 +202,7 @@ pub extern "C" fn pgp_status_to_string(status: Status) -> *const c_char { Expired => "Expired\x00", NotYetLive => "Not yet live\x00", NoBindingSignature => "No binding signature\x00", + InvalidKey => "Invalid key\x00", }.as_bytes().as_ptr() as *const c_char } @@ -256,6 +260,8 @@ impl<'a> From<&'a failure::Error> for Status { Status::NotYetLive, &openpgp::Error::NoBindingSignature(_) => Status::NoBindingSignature, + &openpgp::Error::InvalidKey(_) => + Status::InvalidKey, openpgp::Error::__Nonexhaustive => unreachable!(), } } |