diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2022-09-08 17:49:08 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2022-09-29 20:10:57 +0200 |
commit | 7936e3513ee339650a7ac2eff11edd2fac3f037d (patch) | |
tree | f57c47e23b8781d0690c8b39f9b9917e1f19edea /sq/src/commands/mod.rs | |
parent | f89695585459799981d83c0b6eecb13511490e56 (diff) |
openpgp, sq: Update dependency rpassword to 6.
- rpassword underwent some rework. The successor of
read_password_from_tty seems to be prompt_password, relevant commits
to rpassword:
- e6023757df00a67a1e16796db50c5ffad41b6268
- 2edf6cee07573ec4aa86531e6177ee90331d5c60
Diffstat (limited to 'sq/src/commands/mod.rs')
-rw-r--r-- | sq/src/commands/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sq/src/commands/mod.rs b/sq/src/commands/mod.rs index a7444391..8c23366d 100644 --- a/sq/src/commands/mod.rs +++ b/sq/src/commands/mod.rs @@ -126,9 +126,9 @@ fn get_keys<C>(certs: &[C], p: &dyn Policy, if let Some(secret) = key.optional_secret() { let unencrypted = match secret { SecretKeyMaterial::Encrypted(ref e) => { - let password = rpassword::read_password_from_tty(Some( + let password = rpassword::prompt_password( &format!("Please enter password to decrypt {}/{}: ", - tsk, key))) + tsk, key)) .context("Reading password from tty")?; e.decrypt(key.pk_algo(), &password.into()) .expect("decryption failed") @@ -140,8 +140,8 @@ fn get_keys<C>(certs: &[C], p: &dyn Policy, .unwrap())); continue 'next_cert; } else if let Some(private_key_store) = private_key_store { - let password = rpassword::read_password_from_tty( - Some(&format!("Please enter password to key {}/{}: ", tsk, key))).unwrap().into(); + let password = rpassword::prompt_password( + &format!("Please enter password to key {}/{}: ", tsk, key)).unwrap().into(); match pks::unlock_signer(private_key_store, key.clone(), &password) { Ok(signer) => { keys.push(signer); @@ -323,12 +323,12 @@ pub fn encrypt(opts: EncryptOpts) -> Result<()> { let mut passwords: Vec<crypto::Password> = Vec::with_capacity(opts.npasswords); for n in 0..opts.npasswords { let nprompt = format!("Enter password {}: ", n + 1); - passwords.push(rpassword::read_password_from_tty(Some( + passwords.push(rpassword::prompt_password( if opts.npasswords > 1 { &nprompt } else { "Enter password: " - }))?.into()); + })?.into()); } if opts.recipients.len() + passwords.len() == 0 { |