From 9acbeac23668a1d0dabca27d7825430d76e095c2 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 14 Sep 2015 11:27:43 +0200 Subject: 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 . 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. --- kbx/keybox-search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kbx/keybox-search.c') 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 */ -- cgit v1.2.3