diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-03-18 12:44:36 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-03-18 14:03:58 +0100 |
commit | 01db33b99244294702f0f58f06c6736becee28db (patch) | |
tree | 0cedce9f950866e1f355787be82a712bcf581ac4 /openpgp-ffi/src/serialize.rs | |
parent | fc387f5c290774a39feff97cde31ea78300d2b23 (diff) |
openpgp: Make hash algorithm configurable in streaming Signer.
- See #208.
Diffstat (limited to 'openpgp-ffi/src/serialize.rs')
-rw-r--r-- | openpgp-ffi/src/serialize.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openpgp-ffi/src/serialize.rs b/openpgp-ffi/src/serialize.rs index 362d2aa6..61e69a98 100644 --- a/openpgp-ffi/src/serialize.rs +++ b/openpgp-ffi/src/serialize.rs @@ -145,7 +145,8 @@ pub extern "system" fn pgp_signer_new (errp: Option<&mut *mut ::error::Error>, inner: *mut writer::Stack<'static, Cookie>, signers: *const *mut Box<self::openpgp::crypto::Signer>, - signers_len: size_t) + signers_len: size_t, + hash_algo: uint8_t) -> *mut writer::Stack<'static, Cookie> { ffi_make_fry_from_errp!(errp); @@ -160,7 +161,7 @@ pub extern "system" fn pgp_signer_new ffi_param_ref_mut!(signer).as_mut() } ).collect(); - ffi_try_box!(Signer::new(*inner, signers)) + ffi_try_box!(Signer::new(*inner, signers, Some(hash_algo.into()))) } /// Creates a signer for a detached signature. @@ -169,7 +170,8 @@ pub extern "system" fn pgp_signer_new_detached (errp: Option<&mut *mut ::error::Error>, inner: *mut writer::Stack<'static, Cookie>, signers: *const *mut Box<self::openpgp::crypto::Signer>, - signers_len: size_t) + signers_len: size_t, + hash_algo: uint8_t) -> *mut writer::Stack<'static, Cookie> { ffi_make_fry_from_errp!(errp); @@ -184,7 +186,7 @@ pub extern "system" fn pgp_signer_new_detached ffi_param_ref_mut!(signer).as_mut() } ).collect(); - ffi_try_box!(Signer::detached(*inner, signers)) + ffi_try_box!(Signer::detached(*inner, signers, Some(hash_algo.into()))) } /// Writes a literal data packet. |