summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-02-06 16:55:59 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-02-06 16:55:59 +0100
commitb62ea3af257e8d2ccb2555959e047f7ea41eb0d6 (patch)
tree458678ca6d805d78ed30e548f0d2516dc6eef1e9 /openpgp-ffi
parentbb19d1ad4b58b6392e0c9588809f690c9e403783 (diff)
openpgp: New error for unsupported packet types.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/include/sequoia/openpgp/error.h5
-rw-r--r--openpgp-ffi/src/error.rs7
2 files changed, 11 insertions, 1 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp/error.h b/openpgp-ffi/include/sequoia/openpgp/error.h
index 157eb44d..2924b8c9 100644
--- a/openpgp-ffi/include/sequoia/openpgp/error.h
+++ b/openpgp-ffi/include/sequoia/openpgp/error.h
@@ -43,6 +43,11 @@ typedef enum pgp_status {
PGP_STATUS_MALFORMED_PACKET = -5,
/*/
+ /// Unsupported packet type.
+ /*/
+ PGP_STATUS_UNSUPPORTED_PACKET_TYPE = -14,
+
+ /*/
/// Unsupported hash algorithm.
/*/
PGP_STATUS_UNSUPPORTED_HASH_ALGORITHM = -9,
diff --git a/openpgp-ffi/src/error.rs b/openpgp-ffi/src/error.rs
index d85a854a..f4d2f5b5 100644
--- a/openpgp-ffi/src/error.rs
+++ b/openpgp-ffi/src/error.rs
@@ -65,6 +65,9 @@ pub enum Status {
/// The packet is malformed.
MalformedPacket = -5,
+ /// Unsupported packet type.
+ UnsupportedPacketType = -14,
+
/// Unsupported hash algorithm.
UnsupportedHashAlgorithm = -9,
@@ -95,7 +98,7 @@ pub enum Status {
/// Malformed TPK.
MalformedTPK = -13,
- // XXX: -14 was UserIDNotFound.
+ // XXX: Skipping UnsupportedPacketType = -14.
// XXX: Skipping InvalidArgument = -15.
@@ -138,6 +141,8 @@ impl<'a> From<&'a failure::Error> for Status {
Status::InvalidOperation,
&openpgp::Error::MalformedPacket(_) =>
Status::MalformedPacket,
+ &openpgp::Error::UnsupportedPacketType(_) =>
+ Status::UnsupportedPacketType,
&openpgp::Error::UnsupportedHashAlgorithm(_) =>
Status::UnsupportedHashAlgorithm,
&openpgp::Error::UnsupportedPublicKeyAlgorithm(_) =>