summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-10-20 15:42:39 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-10-20 16:09:59 +0200
commit14c3a12554fa8b5c46b3905162bd9f09695f6dc3 (patch)
treec1b66dd2fc6e4123b8f721dd5116ad0d5df7ce35 /openpgp/src/parse
parentc0e6062d20ecbcba76a342e7f8c7c129fe9286eb (diff)
openpgp: Pop the armor filter off the stack after parsing.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/packet_parser_builder.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp/src/parse/packet_parser_builder.rs b/openpgp/src/parse/packet_parser_builder.rs
index ae180524..a3a14e22 100644
--- a/openpgp/src/parse/packet_parser_builder.rs
+++ b/openpgp/src/parse/packet_parser_builder.rs
@@ -415,8 +415,11 @@ impl<'a> PacketParserBuilder<'a> {
};
if let Some(mode) = dearmor_mode {
+ // Add a top-level filter so that it is peeled off when
+ // the packet parser is finished. We use level -2 for that.
self.bio =
- armor::Reader::from_buffered_reader(self.bio, Some(mode))
+ armor::Reader::from_buffered_reader(self.bio, Some(mode),
+ Cookie::new(-2))
.as_boxed();
}