diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-05-13 13:46:41 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-05-13 16:04:03 +0200 |
commit | 3928cd36f63869fc37c78d991d38d13badcb4e80 (patch) | |
tree | cc1d543ec948fa48a79c9c99ed570f19364bd45b /openpgp-ffi/src/serialize.rs | |
parent | ed092e1bf26f7473c058b0c4524348538d649d2f (diff) |
openpgp: Unawkwardify Encryptor::add_password.
Diffstat (limited to 'openpgp-ffi/src/serialize.rs')
-rw-r--r-- | openpgp-ffi/src/serialize.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/openpgp-ffi/src/serialize.rs b/openpgp-ffi/src/serialize.rs index 610cb7f1..20ccc684 100644 --- a/openpgp-ffi/src/serialize.rs +++ b/openpgp-ffi/src/serialize.rs @@ -366,7 +366,7 @@ pub extern "C" fn pgp_encryptor_new<'a> }; for password in passwords { passwords_.push(ffi_param_cstr!(*password) - .to_bytes().to_owned().into()); + .to_bytes().to_owned()); } } let mut recipients_ = Vec::new(); @@ -394,10 +394,8 @@ pub extern "C" fn pgp_encryptor_new<'a> "Neither recipient nor password given"))); } - let mut encryptor = Encryptor::for_recipients(*inner, recipients_); - for p in passwords_ { - encryptor = encryptor.add_password(p); - } + let mut encryptor = Encryptor::for_recipients(*inner, recipients_) + .add_passwords(passwords_); if let Some(algo) = cipher_algo { encryptor = encryptor.symmetric_algo(algo); } |