On Mon, 29 Aug 2016 04:25, c...@nymph.paranoici.org said:

>>No, this would be a bug.
>
> I get an error 0x02 in return:

This is a regression in 2.1.14.  Workaround is to either set
--default-key or --try-secret-key.  Patch attached.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
 /* Join us at OpenPGP.conf  <https://openpgp-conf.org> */
From bdbd03608b6f508ac4732f9986a046de8a85a311 Mon Sep 17 00:00:00 2001
From: Werner Koch <w...@gnupg.org>
Date: Mon, 29 Aug 2016 07:55:06 +0200
Subject: [PATCH] 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 <w...@gnupg.org>
---
 g10/getkey.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/g10/getkey.c b/g10/getkey.c
index 90083ba..8b17598 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -3620,17 +3620,14 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
                     c->state++;
                   break;
 
-                case 3: /* Init search context to try all keys.  */
-                  if (opt.try_all_secrets)
+                case 3: /* Init search context to enum all secret keys.  */
+                  err = getkey_bynames (&c->ctx, NULL, NULL, 1, &keyblock);
+                  if (err)
                     {
-                      err = getkey_bynames (&c->ctx, NULL, NULL, 1, &keyblock);
-                      if (err)
-                        {
-                          release_kbnode (keyblock);
-                          keyblock = NULL;
-                          getkey_end (c->ctx);
-                          c->ctx = NULL;
-                        }
+                      release_kbnode (keyblock);
+                      keyblock = NULL;
+                      getkey_end (c->ctx);
+                      c->ctx = NULL;
                     }
                   c->state++;
                   break;
-- 
2.8.1

Attachment: pgpRbNs5VDLra.pgp
Description: PGP signature

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to