gpg: Fix keyring support.
authorNeal H. Walfield <neal@g10code.com>
Thu, 29 Oct 2015 08:52:56 +0000 (09:52 +0100)
committerNeal H. Walfield <neal@g10code.com>
Thu, 29 Oct 2015 09:10:39 +0000 (10:10 +0100)
* g10/keydb.c (keydb_rebuild_caches): Only mark the cached as prepared
if it is actually prepared, which it only is if the resource is a
keybox.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
g10/keydb.c

index da18bc0..bcafe90 100644 (file)
@@ -1701,7 +1701,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
   if (!hd->no_caching
       && !rc
       && ndesc == 1 && (desc[0].mode == KEYDB_SEARCH_MODE_FPR20
-                        || desc[0].mode == KEYDB_SEARCH_MODE_FPR))
+                        || desc[0].mode == KEYDB_SEARCH_MODE_FPR)
+      && hd->active[hd->current].type == KEYDB_RESOURCE_TYPE_KEYBOX)
     {
       hd->keyblock_cache.state = KEYBLOCK_CACHE_PREPARED;
       memcpy (hd->keyblock_cache.fpr, desc[0].u.fpr, 20);