[Pkg-gnupg-commit] [gnupg2] 12/118: gpg: Make decryption of -R work w/o --try-secret-key or --default-key.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 15 18:24:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch encoding-and-speling
in repository gnupg2.

commit bdbd03608b6f508ac4732f9986a046de8a85a311
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Aug 29 07:55:06 2016 +0200

    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 at 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list