summaryrefslogtreecommitdiffstats
path: root/autocrypt
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-07-24 15:49:43 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-07-24 16:45:10 +0200
commit0ac1c16d62b7a1900779be513579419f6a0ec730 (patch)
tree29b3c71f21b38c8cff04dd84de93c1dc561d9f33 /autocrypt
parent14fe75c02b0ae03440d5ba25efe8d1c64119272c (diff)
openpgp: Improve PacketParserResult::as_ref, as_mut, and map.
- Previously, these method withheld information in the EOF case (and in case of `map` this loss is irrecoverable). Fix this by returning a Result instead.
Diffstat (limited to 'autocrypt')
-rw-r--r--autocrypt/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs
index 06dbd696..b42e3153 100644
--- a/autocrypt/src/lib.rs
+++ b/autocrypt/src/lib.rs
@@ -686,7 +686,7 @@ impl<'a> AutocryptSetupMessageParser<'a> {
// Recurse into the SEIP packet.
let mut ppr = self.pp.recurse()?.1;
- if ppr.as_ref().map(|pp| pp.recursion_depth()) != Some(1) {
+ if ppr.as_ref().map(|pp| pp.recursion_depth()).ok() != Some(1) {
return Err(
Error::MalformedMessage(
"SEIP container empty, but expected a Literal Data packet"