diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-05-07 15:36:37 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-05-07 17:00:52 +0200 |
commit | 3eb554d0980ae788df2a07df609b77e01b7e57ce (patch) | |
tree | 1a36348c4e7dd5ec7b3f83b6ed5d93b80a0e200d /openpgp-ffi/src/parse/stream.rs | |
parent | 50b3ed9a61161761f20d134b13c2f8ac07698ea5 (diff) |
openpgp: Use a builder to construct Decryptor.
- See #498.
Diffstat (limited to 'openpgp-ffi/src/parse/stream.rs')
-rw-r--r-- | openpgp-ffi/src/parse/stream.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/openpgp-ffi/src/parse/stream.rs b/openpgp-ffi/src/parse/stream.rs index a0a65df3..9c900a76 100644 --- a/openpgp-ffi/src/parse/stream.rs +++ b/openpgp-ffi/src/parse/stream.rs @@ -28,7 +28,7 @@ use self::openpgp::{ use self::openpgp::parse::stream::{ self, DecryptionHelper, - Decryptor, + DecryptorBuilder, VerificationHelper, VerifierBuilder, }; @@ -1057,11 +1057,13 @@ fn pgp_decryptor_new<'a>(errp: Option<&mut *mut crate::error::Error>, time: time_t) -> Maybe<io::Reader> { + ffi_make_fry_from_errp!(errp); let policy = policy.ref_raw().as_ref(); let helper = DHelper::new( get_certs, decrypt, check, inspect, cookie); - Decryptor::from_reader(policy, input.ref_mut_raw(), helper, maybe_time(time)) + ffi_try_or!(DecryptorBuilder::from_reader(input.ref_mut_raw()), None) + .with_policy(policy, maybe_time(time), helper) .map(|r| io::ReaderKind::Generic(Box::new(r))) .move_into_raw(errp) } |