summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2021-09-17 14:10:50 +0200
committerJustus Winter <justus@sequoia-pgp.org>2021-10-05 14:10:53 +0200
commited938836a6928ae4daae9ac3ce8dc68ed21f3407 (patch)
treebfcce342575748eea83383cfa54133c6d6672bf7
parent30ae9da9de1b7ed1c991bfae68d8e37c122937e9 (diff)
sq: Don't panic if reading the password fails.
Reported by: Jörg Knobloch <jorgk@jorgk.com>.
-rw-r--r--sq/src/commands/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/sq/src/commands/mod.rs b/sq/src/commands/mod.rs
index 304ee475..c6d2c54a 100644
--- a/sq/src/commands/mod.rs
+++ b/sq/src/commands/mod.rs
@@ -69,7 +69,8 @@ fn get_signing_keys(certs: &[openpgp::Cert], p: &dyn Policy,
SecretKeyMaterial::Encrypted(ref e) => {
let password = rpassword::read_password_from_tty(Some(
&format!("Please enter password to decrypt {}/{}: ",
- tsk, key))).unwrap();
+ tsk, key)))
+ .context("Reading password from tty")?;
e.decrypt(key.pk_algo(), &password.into())
.expect("decryption failed")
},