summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-04-03 18:22:55 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-04-03 18:32:03 +0200
commita9ca727cab50c0c91098a7ef8aea79f5f62a1f5c (patch)
treee7122be749e5b3b26ee96969f4f9e8347fe6532b /openpgp-ffi
parent6494b37775ada713e8ff139ee40c5accdfcaf16a (diff)
openpgp: Unawkwardify the streaming encryptor.
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);
}