summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-11-27 14:07:58 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-11-27 14:09:26 +0100
commit5eb6ad9f545291f05f5f2455684da68594c8a4dd (patch)
tree4e7aaae032f0aef7c8606a5ddc3c0ff51095fae3 /openpgp-ffi
parent6fa1c0c42d21c7876c594f9c658742f6639f86b9 (diff)
openpgp: Fix issuer handling in the streaming verifier.
- To that end, make VerificationHelper::get_public_keys take KeyHandles for all the issuers.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/src/parse/stream.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/openpgp-ffi/src/parse/stream.rs b/openpgp-ffi/src/parse/stream.rs
index 608c7b85..6e38739b 100644
--- a/openpgp-ffi/src/parse/stream.rs
+++ b/openpgp-ffi/src/parse/stream.rs
@@ -334,13 +334,14 @@ impl VHelper {
}
impl VerificationHelper for VHelper {
- fn get_public_keys(&mut self, ids: &[openpgp::KeyID])
+ fn get_public_keys(&mut self, ids: &[openpgp::KeyHandle])
-> Result<Vec<openpgp::TPK>, failure::Error>
{
- // The size of KeyID is not known in C. Convert from an array
- // of KeyIDs to an array of KeyID refs.
+ // The size of ID is not known in C. Convert to KeyID, and
+ // move it to C.
let ids : Vec<*mut keyid::KeyID> =
- ids.iter().map(|k| k.move_into_raw()).collect();
+ ids.iter().map(|k| openpgp::KeyID::from(k.clone()).move_into_raw())
+ .collect();
let mut tpk_refs_raw : *mut *mut TPK = ptr::null_mut();
let mut tpk_refs_raw_len = 0usize;
@@ -657,7 +658,7 @@ impl DHelper {
}
impl VerificationHelper for DHelper {
- fn get_public_keys(&mut self, ids: &[openpgp::KeyID])
+ fn get_public_keys(&mut self, ids: &[openpgp::KeyHandle])
-> Result<Vec<openpgp::TPK>, failure::Error>
{
self.vhelper.get_public_keys(ids)