summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-03-03 18:36:37 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-03-22 11:40:50 +0100
commit2f140c0a621a78f7669e5758151ee6f6b00f69d0 (patch)
treed88366295069ccde0beededccdb982a4ce3b381b
parent7e108d056bc6887aa774c73ad6dedc07e99baeb2 (diff)
fixup! wip: very rough padding packet support
-rw-r--r--openpgp/src/parse.rs11
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),