summaryrefslogtreecommitdiffstats
path: root/openpgp/src/cert/parser/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/cert/parser/mod.rs')
-rw-r--r--openpgp/src/cert/parser/mod.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/openpgp/src/cert/parser/mod.rs b/openpgp/src/cert/parser/mod.rs
index d376c0c1..aea9c101 100644
--- a/openpgp/src/cert/parser/mod.rs
+++ b/openpgp/src/cert/parser/mod.rs
@@ -757,11 +757,19 @@ impl<'a> CertParser<'a> {
// returns None.
fn parse(&mut self, p: Packet) -> Result<Option<Cert>> {
tracer!(TRACE, "CertParser::parse", 0);
- if let Packet::Marker(_) = p {
- // Ignore Marker Packet. RFC4880, section 5.8:
- //
- // Such a packet MUST be ignored when received.
- return Ok(None);
+ match p {
+ Packet::Marker(_) => {
+ // Ignore Marker Packet. RFC4880, section 5.8:
+ //
+ // Such a packet MUST be ignored when received.
+ return Ok(None);
+ },
+ Packet::Padding(_) => {
+ // "[Padding packets] MUST be ignored when received.",
+ // section 5.15 of RFC XXXX.
+ return Ok(None);
+ },
+ _ => {},
}
if !self.packets.is_empty() {