summaryrefslogtreecommitdiffstats
path: root/tool/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-04-09 14:34:22 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-04-09 14:34:22 +0200
commite3b30cebc5fabcd9abc1b4bd109c4816e06a2f01 (patch)
treea0fededc9c71da3ab2838dc02d41c3235f99c3a8 /tool/src
parent2bf852b9958569856d949c9ee8851c1a627138f6 (diff)
tool: Don't ask the user to decrypt a key we don't support.
Diffstat (limited to 'tool/src')
-rw-r--r--tool/src/commands/decrypt.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs
index 01bb0eef..cd07e624 100644
--- a/tool/src/commands/decrypt.rs
+++ b/tool/src/commands/decrypt.rs
@@ -135,6 +135,12 @@ impl<'a> DecryptionHelper for Helper<'a> {
// Second, we try those keys that are encrypted.
'pkesk_loop: for pkesk in pkesks {
+ // Don't ask the user to decrypt a key if we don't support
+ // the algorithm.
+ if ! pkesk.pk_algo().is_supported() {
+ continue;
+ }
+
let keyid = pkesk.recipient();
if let Some(key) = self.secret_keys.get(&keyid) {
if key.secret().map(|s| ! s.is_encrypted())