diff options
Diffstat (limited to 'kbx')
-rw-r--r-- | kbx/keybox-search-desc.h | 8 | ||||
-rw-r--r-- | kbx/keybox-search.c | 4 |
2 files changed, 9 insertions, 3 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 */ diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c index 05b6859d2..cb07c97fd 100644 --- a/kbx/keybox-search.c +++ b/kbx/keybox-search.c @@ -1010,8 +1010,8 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc, if (desc[n].skipfnc && blob_get_first_keyid (blob, kid) - && desc[n].skipfnc (desc[n].skipfncvalue, kid, NULL)) - break; + && desc[n].skipfnc (desc[n].skipfncvalue, kid, uid_no)) + break; } if (n == ndesc) break; /* got it */ |