From 2ca90f78cee91c43b8d538d1cb92728f8e1452d5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 9 Oct 2014 21:01:49 +0200 Subject: gpg: Skip overlong keys and a print a warning. * kbx/keybox-search.c (keybox_search): Add arg r_skipped and skip too long blobs. * sm/keydb.c (keydb_search): Call keybox_search with a dummy param. * g10/keydb.c (struct keydb_handle): Add field skipped_long_blobs. (keydb_search_reset): Reset that field. (keydb_search): Update that field. (keydb_get_skipped_counter): New. * g10/keylist.c (list_all): Print count of skipped keys. Signed-off-by: Werner Koch --- sm/keydb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sm/keydb.c') diff --git a/sm/keydb.c b/sm/keydb.c index fb0947a93..83e573f28 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -958,6 +958,7 @@ int keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc) { int rc = -1; + unsigned long skipped; if (!hd) return gpg_error (GPG_ERR_INV_VALUE); @@ -970,7 +971,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc) BUG(); /* we should never see it here */ break; case KEYDB_RESOURCE_TYPE_KEYBOX: - rc = keybox_search (hd->active[hd->current].u.kr, desc, ndesc, NULL); + rc = keybox_search (hd->active[hd->current].u.kr, desc, ndesc, + NULL, &skipped); break; } if (rc == -1) /* EOF -> switch to next resource */ -- cgit v1.2.3