summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-06-24 09:53:27 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-06-24 17:57:53 +0200
commit664316de70555d350886cd2c416b3c7da86af3ad (patch)
tree19aee7789581b1d998bd1bda89688cefbd06b41b /tool
parent660e5352c0cb57f0a9f49bf0d9367b723884f2db (diff)
openpgp, tool: Fix decryption.
- Try to decrypt all PKESKs, not just the first one.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/commands/decrypt.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs
index a8c72f96..37e00a9f 100644
--- a/tool/src/commands/decrypt.rs
+++ b/tool/src/commands/decrypt.rs
@@ -124,7 +124,7 @@ impl<'a> DecryptionHelper for Helper<'a> {
if let Some(key) = self.secret_keys.get(&keyid) {
if let Some(SecretKey::Unencrypted { .. }) = key.secret() {
if let Ok(sk) = key.clone().into_keypair()
- .and_then(|mut keypair| pkesks[0].decrypt(&mut keypair))
+ .and_then(|mut keypair| pkesk.decrypt(&mut keypair))
.and_then(|(algo, sk)| { decrypt(algo, &sk)?; Ok(sk) })
{
if self.dump_session_key {