summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/src/serialize.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/openpgp-ffi/src/serialize.rs b/openpgp-ffi/src/serialize.rs
index 394c3475..4669cb41 100644
--- a/openpgp-ffi/src/serialize.rs
+++ b/openpgp-ffi/src/serialize.rs
@@ -395,17 +395,10 @@ pub extern "C" fn pgp_encryptor_new<'a>
"Neither recipient nor password given")));
}
- let mut encryptor = if let Some(p) = passwords_.pop() {
- Encryptor::with_password(*inner, p)
- } else {
- Encryptor::for_recipient(*inner, recipients_.pop().unwrap())
- };
+ let mut encryptor = Encryptor::for_recipients(*inner, recipients_);
for p in passwords_ {
encryptor = encryptor.add_password(p);
}
- for r in recipients_ {
- encryptor = encryptor.add_recipient(r);
- }
if let Some(algo) = cipher_algo {
encryptor = encryptor.sym_algo(algo);
}