diff options
-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), |