From 0ac1c16d62b7a1900779be513579419f6a0ec730 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 24 Jul 2020 15:49:43 +0200 Subject: 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. --- autocrypt/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'autocrypt') 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" -- cgit v1.2.3