gpg: Fix export bug using exact search with only one key in the keybox.

* g10/export.c (do_export_stream): Disable caching.
* g10/keyserver.c (keyidlist): Ditto.
--

GnuPG-bug-id: 1774
This commit is contained in:
Werner Koch 2014-12-01 11:54:51 +01:00
parent 2f90b7c21b
commit f1c3eb4b16
3 changed files with 7 additions and 1 deletions

View File

@ -804,6 +804,8 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
sl->d, gpg_strerror (err)); sl->d, gpg_strerror (err));
} }
keydb_disable_caching (kdbhd); /* We are looping the search. */
/* It would be nice to see which of the given users did actually /* It would be nice to see which of the given users did actually
match one in the keyring. To implement this we need to have match one in the keyring. To implement this we need to have
a found flag for each entry in desc. To set this flag we a found flag for each entry in desc. To set this flag we

View File

@ -1424,6 +1424,9 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
if (DBG_CACHE) if (DBG_CACHE)
dump_search_desc (hd, "keydb_search", desc, ndesc); dump_search_desc (hd, "keydb_search", desc, ndesc);
/* NB: If one of the exact search modes below is used in a loop to
walk over all keys (with the same fingerprint) the caching must
have been disabled for the handle. */
if (!hd->no_caching if (!hd->no_caching
&& ndesc == 1 && ndesc == 1
&& (desc[0].mode == KEYDB_SEARCH_MODE_FPR20 && (desc[0].mode == KEYDB_SEARCH_MODE_FPR20

View File

@ -1229,7 +1229,8 @@ keyidlist(strlist_t users,KEYDB_SEARCH_DESC **klist,int *count,int fakev3)
*klist=xmalloc(sizeof(KEYDB_SEARCH_DESC)*num); *klist=xmalloc(sizeof(KEYDB_SEARCH_DESC)*num);
kdbhd=keydb_new (); kdbhd = keydb_new ();
keydb_disable_caching (kdbhd); /* We are looping the search. */
if(!users) if(!users)
{ {