diff options
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r-- | openpgp/src/parse.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index 35f0156a..df772c17 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -2871,6 +2871,19 @@ impl AED1 { } } +impl Padding { + /// Parses the body of a padding packet. + fn parse<'a, T: 'a + BufferedReader<Cookie>>(mut php: PacketHeaderParser<T>) + -> Result<PacketParser<'a>> + { + make_php_try!(php); + let value = php_try!(php.parse_bytes_eof("value")); + php.ok(Packet::Padding(Padding::from(value))) + } +} + +impl_parse_generic_packet!(Padding); + impl MPI { /// Parses an OpenPGP MPI. /// @@ -4134,6 +4147,7 @@ impl <'a> PacketParser<'a> { Err(Error::MalformedPacket("Looks like garbage".into()).into()), Tag::Marker => Marker::plausible(bio, header), + Tag::Padding => Ok(()), Tag::Signature => Signature::plausible(bio, header), Tag::SecretKey => Key::plausible(bio, header), @@ -4364,6 +4378,7 @@ impl <'a> PacketParser<'a> { Tag::MDC => MDC::parse(parser), Tag::PKESK => PKESK::parse(parser), Tag::AED => AED::parse(parser), + Tag::Padding => Padding::parse(parser), _ => Unknown::parse(parser, Error::UnsupportedPacketType(tag).into()), }?; @@ -4649,7 +4664,8 @@ impl <'a> PacketParser<'a> { | Packet::Marker(_) | Packet::Trust(_) | Packet::UserID(_) | Packet::UserAttribute(_) | Packet::Literal(_) | Packet::PKESK(_) | Packet::SKESK(_) - | Packet::SEIP(_) | Packet::MDC(_) | Packet::AED(_) => { + | Packet::SEIP(_) | Packet::MDC(_) | Packet::AED(_) + | Packet::Padding(_) => { // Drop through. t!("A {:?} packet is not a container, not recursing.", self.packet.tag()); |