diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-02-12 15:40:16 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-02-12 15:53:05 +0100 |
commit | a1f3d6263ceddad1304e642e316fbd461b0478e1 (patch) | |
tree | daff9b061e153b808069838f223e4722becd501a /openpgp-ffi/src/common.rs | |
parent | cb73fa51b3a7c93784cf565da61d863dc619f547 (diff) |
openpgp-ffi: Fix wrapping of Fingerprints and KeyIDs.
Diffstat (limited to 'openpgp-ffi/src/common.rs')
-rw-r--r-- | openpgp-ffi/src/common.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/openpgp-ffi/src/common.rs b/openpgp-ffi/src/common.rs index d76ea7a1..0ee14566 100644 --- a/openpgp-ffi/src/common.rs +++ b/openpgp-ffi/src/common.rs @@ -467,7 +467,7 @@ type FreeCallback = fn(*mut c_void); /// If the free callback is not NULL, then it is called to free the /// returned array of TPKs. type GetPublicKeysCallback = fn(*mut HelperCookie, - *const &openpgp::KeyID, usize, + *const *mut keyid::KeyID, usize, &mut *mut *mut TPK, *mut usize, *mut FreeCallback) -> Status; @@ -512,7 +512,8 @@ impl VerificationHelper for VHelper { { // The size of KeyID is not known in C. Convert from an array // of KeyIDs to an array of KeyID refs. - let ids : Vec<&openpgp::KeyID> = ids.iter().collect(); + let ids : Vec<*mut keyid::KeyID> = + ids.iter().map(|k| k.move_into_raw()).collect(); let mut tpk_refs_raw : *mut *mut TPK = ptr::null_mut(); let mut tpk_refs_raw_len = 0usize; @@ -524,6 +525,8 @@ impl VerificationHelper for VHelper { ids.as_ptr(), ids.len(), &mut tpk_refs_raw, &mut tpk_refs_raw_len as *mut usize, &mut free); + ids.into_iter().for_each(|k| { k.move_from_raw(); }); + if result != Status::Success { // XXX: We need to convert the status to an error. A // status contains less information, but we should do the |