diff options
author | Neal H. Walfield <neal@g10code.com> | 2015-09-14 11:27:43 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@g10code.com> | 2015-09-16 15:15:20 +0200 |
commit | 9acbeac23668a1d0dabca27d7825430d76e095c2 (patch) | |
tree | 3bdcc4b5f427d14a2b7a505d0cb9d95be4d731a6 /kbx/keybox-search-desc.h | |
parent | g10: Remove unused prototype (get_pubkey_byfpr). (diff) | |
download | gnupg2-9acbeac23668a1d0dabca27d7825430d76e095c2.tar.xz gnupg2-9acbeac23668a1d0dabca27d7825430d76e095c2.zip |
kbx: Change skipfnc's prototype so that we can provide all information.
* kbx/keybox-search-desc.h (struct keydb_search_desc.skipfnc): Change
third parameter to be the index of the user id packet in the keyblock
rather than the packet itself. Update users.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
The keybox code doesn't work directly with keyblocks. As such, the
matched user packet is not readily available to pass to
DESC[n].SKIPFNC. But, we do know the index of the user id packet that
matched. Thus, pass that instead. If the skip function needs the
user id packet, it can use the key id to look up the key block and
find the appropriate packet.
Diffstat (limited to 'kbx/keybox-search-desc.h')
-rw-r--r-- | kbx/keybox-search-desc.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kbx/keybox-search-desc.h b/kbx/keybox-search-desc.h index ec7a3c139..fd8ffe427 100644 --- a/kbx/keybox-search-desc.h +++ b/kbx/keybox-search-desc.h @@ -57,7 +57,13 @@ typedef struct gpg_pkt_user_id_s *gpg_pkt_user_id_t; struct keydb_search_desc { KeydbSearchMode mode; - int (*skipfnc)(void *, u32 *, gpg_pkt_user_id_t); + /* Callback used to filter results. The first parameter is + SKIPFUNCVALUE. The second is the keyid. The third is the + 1-based index of the UID packet that matched the search criteria + (or 0, if none). + + Return non-zero if the result should be skipped. */ + int (*skipfnc)(void *, u32 *, int); void *skipfncvalue; const unsigned char *sn; int snlen; /* -1 := sn is a hex string */ |