summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openpgp/src/parse/stream.rs5
-rw-r--r--openpgp/src/policy.rs2
2 files changed, 3 insertions, 4 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 4e8c652e..32f1c2ab 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -1319,10 +1319,9 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
decryption_proxy)?;
}
if ! pp.decrypted() {
- // XXX: That is not quite the right error to return.
return Err(
- Error::InvalidSessionKey("No session key".into())
- .into());
+ Error::MissingSessionKey(
+ "No session key decrypted".into()).into());
}
let sym_algo =
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs
index e0cd0088..016b5aa2 100644
--- a/openpgp/src/policy.rs
+++ b/openpgp/src/policy.rs
@@ -1772,7 +1772,7 @@ mod test {
Helper {}, crate::frozen_time());
match r {
Ok(_) => panic!(),
- Err(e) => assert_match!(Error::InvalidSessionKey(_)
+ Err(e) => assert_match!(Error::MissingSessionKey(_)
= e.downcast().unwrap()),
}