From d95f05c314adfecbe0af9073f964030010442f9b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sun, 2 Nov 2014 16:36:40 +0100 Subject: [PATCH] gpg: Fix endless loop in keylisting with fingerprint. * g10/getkey.c (getkey_next): Disable cache. -- Signed-off-by: Werner Koch --- g10/getkey.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/g10/getkey.c b/g10/getkey.c index fe183faaf..4a4dd551d 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1232,6 +1232,12 @@ getkey_next (getkey_ctx_t ctx, PKT_public_key *pk, kbnode_t *ret_keyblock) { int rc; /* Fixme: Make sure this is proper gpg_error */ + /* We need to disable the caching so that for an exact key search we + won't get the result back from the cache and thus end up in an + endless loop. Disabling this here is sufficient because although + the result has been cached, if won't be used then. */ + keydb_disable_caching (ctx->kr_handle); + rc = lookup (ctx, ret_keyblock, ctx->want_secret); if (!rc && pk && ret_keyblock) pk_from_block (ctx, pk, *ret_keyblock);