diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-02-09 17:32:17 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-02-09 17:32:17 +0100 |
commit | 7c443124abce89ba64c77a9a218228a4f5cc2856 (patch) | |
tree | d02fa54727ea4dfe16c9e57b2334768d5da36941 /openpgp-ffi | |
parent | 1855e7bde6becc05b70bd661abf5a56512e33c37 (diff) |
openpgp: Add new error, PolicyViolation.
Diffstat (limited to 'openpgp-ffi')
-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 b26610a5..01e4ed44 100644 --- a/openpgp-ffi/src/error.rs +++ b/openpgp-ffi/src/error.rs @@ -159,6 +159,9 @@ pub enum Status { /// Invalid key. InvalidKey = -33, + + /// Policy violation. + PolicyViolation = -34, } /// Returns the error message. @@ -203,6 +206,7 @@ pub extern "C" fn pgp_status_to_string(status: Status) -> *const c_char { NotYetLive => "Not yet live\x00", NoBindingSignature => "No binding signature\x00", InvalidKey => "Invalid key\x00", + PolicyViolation => "Policy violation\x00", }.as_bytes().as_ptr() as *const c_char } @@ -262,6 +266,8 @@ impl<'a> From<&'a failure::Error> for Status { Status::NoBindingSignature, &openpgp::Error::InvalidKey(_) => Status::InvalidKey, + &openpgp::Error::PolicyViolation(_, _) => + Status::PolicyViolation, openpgp::Error::__Nonexhaustive => unreachable!(), } } |