summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-01-20 17:33:04 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-01-20 17:34:27 +0100
commitde209ea8a2593be7a45b81f86a8d82cf441640d2 (patch)
treee6804e7d9230b1dba2aa6a31ec1ddfb5c80c49b6
parent25e3d52b7e496405aaef187e49dd052ee1cecf05 (diff)
openpgp: Fix decryption of AED messages using SKESK5.
- Previously, we used the cipher algorithm returned by SKESK5::decrypt, which always returns SymmetricAlgorithm::Unencrypted.
-rw-r--r--openpgp/src/parse/stream.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 89535ac3..bd0a07ce 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -2350,6 +2350,9 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
let mut sym_algo = None;
{
let decryption_proxy = |algo, secret: &SessionKey| {
+ // Take the algo from the AED packet over
+ // the dummy one from the SKESK5 packet.
+ let algo = sym_algo_hint.unwrap_or(algo);
let result = pp.decrypt(algo, secret);
if let Ok(_) = result {
sym_algo = Some(algo);