diff options
author | Neal H. Walfield <neal@pep.foundation> | 2018-06-13 10:54:07 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2018-06-13 11:26:25 +0200 |
commit | fcd17c06cc05979ae43ac72d687e4ad966a19658 (patch) | |
tree | 0650153ce14f6584a6ab2649ef24bb5132de2ce4 /ffi | |
parent | 820b48c387eaf3f03e7cb80f54f703f1031a342d (diff) |
openpgp: Add support for checking OpenPGP messages.
- According to Section 11.3 of RFC 4880, an OpenPGP message is not
just a sequence of packets, but a sequence of packets that conform
to a particular grammar.
- Introduce the `Message` type, which is just a wrapper around a
`PacketPile`, but only accepts `PacketPile`s that conform to this
grammar.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/src/error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 3c1a0fd6..e47abd74 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -113,6 +113,8 @@ pub enum Status { // XXX: Skipping UnsupportedSignatureType = -20 // XXX: Skipping UnsupportedEllipticCurve = -21 + + MalformedMessage = -22, } impl<'a> From<&'a failure::Error> for Status { @@ -160,6 +162,8 @@ impl<'a> From<&'a failure::Error> for Status { Status::MalformedMPI, &openpgp::Error::BadSignature(_) => Status::BadSignature, + &openpgp::Error::MalformedMessage(_) => + Status::MalformedMessage, } } |