diff options
Diffstat (limited to 'tool/src')
-rw-r--r-- | tool/src/commands/decrypt.rs | 8 | ||||
-rw-r--r-- | tool/src/commands/key.rs | 8 | ||||
-rw-r--r-- | tool/src/commands/mod.rs | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index d93dd928..50dae859 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -144,10 +144,10 @@ impl<'a> DecryptionHelper for Helper<'a> { } loop { - let p = rpassword::prompt_password_stderr( + let p = rpassword::read_password_from_tty(Some( &format!( "Enter password to decrypt key {}: ", - self.key_hints.get(&keyid).unwrap())) + self.key_hints.get(&keyid).unwrap()))) ?.into(); if let Ok(mpis) = @@ -180,8 +180,8 @@ impl<'a> DecryptionHelper for Helper<'a> { // Finally, try to decrypt using the SKESKs. loop { let password = - rpassword::prompt_password_stderr( - "Enter password to decrypt message: ")?.into(); + rpassword::read_password_from_tty(Some( + "Enter password to decrypt message: "))?.into(); for skesk in skesks { if let Ok(sk) = skesk.decrypt(&password) diff --git a/tool/src/commands/key.rs b/tool/src/commands/key.rs index a1c9777b..91b2d941 100644 --- a/tool/src/commands/key.rs +++ b/tool/src/commands/key.rs @@ -70,10 +70,10 @@ pub fn generate(m: &ArgMatches, force: bool) -> failure::Fallible<()> { } if m.is_present("with-password") { - let p0 = rpassword::prompt_password_stderr( - "Enter password to protect the key: ")?.into(); - let p1 = rpassword::prompt_password_stderr( - "Repeat the password once more: ")?.into(); + let p0 = rpassword::read_password_from_tty(Some( + "Enter password to protect the key: "))?.into(); + let p1 = rpassword::read_password_from_tty(Some( + "Repeat the password once more: "))?.into(); if p0 == p1 { builder = builder.set_password(Some(p0)); diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index 393bddcc..ca099eaf 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -51,9 +51,9 @@ fn get_signing_keys(tpks: &[openpgp::TPK]) -> Result<Vec<crypto::KeyPair>> { if let Some(mut secret) = key.secret() { let secret_mpis = match secret { SecretKey::Encrypted { .. } => { - let password = rpassword::prompt_password_stderr( + let password = rpassword::read_password_from_tty(Some( &format!("Please enter password to decrypt {}/{}: ", - tsk, key)).unwrap(); + tsk, key))).unwrap(); secret.decrypt(key.pk_algo(), &password.into()) .expect("decryption failed") }, @@ -85,12 +85,12 @@ pub fn encrypt(store: &mut store::Store, let mut passwords = Vec::with_capacity(npasswords); for n in 0..npasswords { let nprompt = format!("Enter password {}: ", n + 1); - passwords.push(rpassword::prompt_password_stderr( + passwords.push(rpassword::read_password_from_tty(Some( if npasswords > 1 { &nprompt } else { "Enter password: " - })?.into()); + }))?.into()); } let mut signers = get_signing_keys(&signers)?; |