diff options
author | Kai Michaelis <kai@sequoia-pgp.org> | 2018-04-23 18:29:30 +0200 |
---|---|---|
committer | Kai Michaelis <kai@sequoia-pgp.org> | 2018-04-23 18:32:22 +0200 |
commit | d1345c3ffbf460f3007f063a989c795cdb50318b (patch) | |
tree | 2fedaabe45e4bf1c4e384aeeb2b65509dcd3d258 /ffi | |
parent | d6918cb480869e8ef911cf57dec63edbacf2ca94 (diff) |
openpgp: Enums for various alogrithms
Adds enums for cryptographic and compression algorithms. Functions that
operate on algo identifiers are now member functions (hash_context ->
HashAlgo::context()).
The identifiers support convertions from and to u8 as well as Display.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/src/openpgp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs index a07b8a04..31ef1566 100644 --- a/ffi/src/openpgp.rs +++ b/ffi/src/openpgp.rs @@ -494,7 +494,7 @@ pub extern "system" fn sq_skesk_decrypt(ctx: Option<&mut Context>, if let &Packet::SKESK(ref skesk) = skesk { match skesk.decrypt(passphrase) { Ok((a, k)) => { - *algo = a; + *algo = a.into(); if !key.is_null() && *key_len >= k.len() { unsafe { ::std::ptr::copy(k.as_ptr(), @@ -807,5 +807,5 @@ pub extern "system" fn sq_packet_parser_decrypt<'a> let key = unsafe { slice::from_raw_parts(key, key_len as usize) }; - fry_status!(ctx, pp.decrypt(algo as u8, key)) + fry_status!(ctx, pp.decrypt((algo as u8).into(), key)) } |