1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg: Make decryption of -R work w/o --try-secret-key or --default-key.

* g10/getkey.c (enum_secret_keys): At state 3 enumerate the keys in all
cases not just when --try-all-secrets is used.
--

Regression-due-to: 82b90eee100cf1c9680517059b2d35e295dd992a
Reported-by: Carola Grunwald
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-08-29 07:55:06 +02:00
parent 0a5a854510
commit bdbd03608b
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -3620,17 +3620,14 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
c->state++; c->state++;
break; break;
case 3: /* Init search context to try all keys. */ case 3: /* Init search context to enum all secret keys. */
if (opt.try_all_secrets) err = getkey_bynames (&c->ctx, NULL, NULL, 1, &keyblock);
if (err)
{ {
err = getkey_bynames (&c->ctx, NULL, NULL, 1, &keyblock); release_kbnode (keyblock);
if (err) keyblock = NULL;
{ getkey_end (c->ctx);
release_kbnode (keyblock); c->ctx = NULL;
keyblock = NULL;
getkey_end (c->ctx);
c->ctx = NULL;
}
} }
c->state++; c->state++;
break; break;