diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2022-03-03 18:36:37 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2022-03-22 11:40:50 +0100 |
commit | 2f140c0a621a78f7669e5758151ee6f6b00f69d0 (patch) | |
tree | d88366295069ccde0beededccdb982a4ce3b381b | |
parent | 7e108d056bc6887aa774c73ad6dedc07e99baeb2 (diff) |
fixup! wip: very rough padding packet support
-rw-r--r-- | openpgp/src/parse.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index 28938b01..154228f8 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -4185,7 +4185,16 @@ impl <'a> PacketParser<'a> { Err(Error::MalformedPacket("Looks like garbage".into()).into()), Tag::Marker => Marker::plausible(bio, header), - Tag::Padding => Ok(()), + Tag::Padding => { + // Even though a padding packet may occur here, it has + // so little structure, that we're likely better off + // trying to find the next packet. + // + // XXX: We could optimize that though, by using the + // potential padding packet's length to see if the + // next packet is plausible. + bad + }, Tag::Signature => Signature::plausible(bio, header), Tag::SecretKey => Key::plausible(bio, header), |