From d4e5e6c48aadd01fc3a96917f36d3ec9649639b6 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 10 Sep 2019 14:20:50 +0200 Subject: openpgp: Make password argument polymorphic. --- tool/src/commands/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tool') diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index 7ba0aab0..44173e04 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -94,7 +94,7 @@ pub fn encrypt(store: &mut store::Store, for r in recipients { tpks.push(store.lookup(r).context("No such key found")?.tpk()?); } - let mut passwords = Vec::with_capacity(npasswords); + let mut passwords: Vec = Vec::with_capacity(npasswords); for n in 0..npasswords { let nprompt = format!("Enter password {}: ", n + 1); passwords.push(rpassword::read_password_from_tty(Some( @@ -124,15 +124,12 @@ pub fn encrypt(store: &mut store::Store, } } - let passwords_: Vec<&openpgp::crypto::Password> = - passwords.iter().collect(); - // Stream an OpenPGP message. let message = Message::new(output); // We want to encrypt a literal data packet. let mut sink = Encryptor::new(message, - &passwords_, + passwords, recipient_subkeys, None, None) .context("Failed to create encryptor")?; -- cgit v1.2.3