diff options
author | Neal H. Walfield <neal@pep.foundation> | 2018-11-22 10:22:29 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2018-11-22 10:22:29 +0100 |
commit | 10a4ccf9670ee3b1c04475a9571fa5f4f5aa39d0 (patch) | |
tree | 20c692690ee05cb4a14171fcc7962032cf36ed17 /ffi | |
parent | 6aefa29ec3d83b07a5882c85f47f386b95f91579 (diff) |
ffi: Fix argument types.
- sq_p_key_fingerprint and sq_p_key_keyid take a packet::Key, not a
Packet.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/src/openpgp.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs index 35f734b4..27df8ff5 100644 --- a/ffi/src/openpgp.rs +++ b/ffi/src/openpgp.rs @@ -1133,31 +1133,19 @@ pub extern "system" fn sq_signature_issuer_fingerprint( /// Computes and returns the key's fingerprint as per Section 12.2 /// of RFC 4880. #[no_mangle] -pub extern "system" fn sq_p_key_fingerprint(key: Option<&Packet>) +pub extern "system" fn sq_p_key_fingerprint(key: Option<&packet::Key>) -> *mut Fingerprint { let key = key.expect("Key is NULL"); - match key { - &Packet::PublicKey(ref key) => box_raw!(key.fingerprint()), - &Packet::PublicSubkey(ref key) => box_raw!(key.fingerprint()), - &Packet::SecretKey(ref key) => box_raw!(key.fingerprint()), - &Packet::SecretSubkey(ref key) => box_raw!(key.fingerprint()), - _ => panic!("Not a Key packet"), - } + box_raw!(key.fingerprint()) } /// Computes and returns the key's key ID as per Section 12.2 of RFC /// 4880. #[no_mangle] -pub extern "system" fn sq_p_key_keyid(key: Option<&Packet>) +pub extern "system" fn sq_p_key_keyid(key: Option<&packet::Key>) -> *mut KeyID { let key = key.expect("Key is NULL"); - match key { - &Packet::PublicKey(ref key) => box_raw!(key.keyid()), - &Packet::PublicSubkey(ref key) => box_raw!(key.keyid()), - &Packet::SecretKey(ref key) => box_raw!(key.keyid()), - &Packet::SecretSubkey(ref key) => box_raw!(key.keyid()), - _ => panic!("Not a Key packet"), - } + box_raw!(key.keyid()) } /// Returns the key's creation time. |