summaryrefslogtreecommitdiffstats
path: root/sq
diff options
context:
space:
mode:
authorLars Wirzenius <liw@sequoia-pgp.org>2021-09-29 15:22:26 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:20 +0300
commitdf6566889a3e439e866fd1940fc6ca303441a6d0 (patch)
tree345541c15a0785c53adcd2786e37592dd3a3463f /sq
parentfb1cbb2c31537c6e24d70ce44a00a28e3281f37b (diff)
Revert "Simplify tests for OK"
Diffstat (limited to 'sq')
-rw-r--r--sq/src/commands/decrypt.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/sq/src/commands/decrypt.rs b/sq/src/commands/decrypt.rs
index 0d874a3b..45e2b4e7 100644
--- a/sq/src/commands/decrypt.rs
+++ b/sq/src/commands/decrypt.rs
@@ -171,7 +171,8 @@ impl<'a> DecryptionHelper for Helper<'a> {
self.key_hints.get(&keyid).unwrap())))?.into();
let algo = key.pk_algo();
- if key.secret_mut().decrypt_in_place(algo, &p).is_ok() {
+ if let Some(()) =
+ key.secret_mut().decrypt_in_place(algo, &p).ok() {
break key.clone().into_keypair().unwrap()
} else {
eprintln!("Bad password.");
@@ -229,7 +230,8 @@ impl<'a> DecryptionHelper for Helper<'a> {
self.key_hints.get(&keyid).unwrap())))?.into();
let algo = key.pk_algo();
- if key.secret_mut().decrypt_in_place(algo, &p).is_ok() {
+ if let Some(()) =
+ key.secret_mut().decrypt_in_place(algo, &p).ok() {
break key.clone().into_keypair().unwrap()
} else {
eprintln!("Bad password.");