From 935edf88ab29b2f63afc2a0e3af1b33c92033ab7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 31 Oct 2014 12:15:34 +0100 Subject: kbx: Let keydb_search skip unwanted blobs. * kbx/keybox.h (keybox_blobtype_t): New. * kbx/keybox-defs.h (BLOBTYPE_*): Replace by KEYBOX_BLOBTYPE_*. * kbx/keybox-search.c (keybox_search): Add arg want_blobtype and skip non-matching blobs. * sm/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_X509 to keybox_search. * g10/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_PGP to keybox_search. -- Without this fix a listing of all keys would fail because the wrong blob type would be returned for the gpg or gpgsm. Signed-off-by: Werner Koch --- g10/keydb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g10') diff --git a/g10/keydb.c b/g10/keydb.c index c192e06b4..a2cab18e2 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -1448,7 +1448,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, break; case KEYDB_RESOURCE_TYPE_KEYBOX: rc = keybox_search (hd->active[hd->current].u.kb, desc, - ndesc, descindex, &hd->skipped_long_blobs); + ndesc, KEYBOX_BLOBTYPE_PGP, + descindex, &hd->skipped_long_blobs); break; } if (rc == -1 || gpg_err_code (rc) == GPG_ERR_EOF) -- cgit v1.2.3