[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.4-8-g339b330

by Werner Koch cvs at cvs.gnupg.org
Mon Jan 8 09:39:32 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, STABLE-BRANCH-2-2 has been updated
       via  339b3301ee8410fe3bbdebb66a6e83801d79d40d (commit)
      from  4d3c500f4793eb263940ff5ef87ec4ead63c9b4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 339b3301ee8410fe3bbdebb66a6e83801d79d40d
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jan 8 09:30:31 2018 +0100

    gpg: Print all keys with --decrypt --list-only.
    
    * g10/mainproc.c (proc_pubkey_enc): Use dedicated error code for
    list-only and put the key into PKENC_LIST.
    (print_pkenc_list): Take care of the new error code.
    --
    
    If the secret keys exist in --list-only mode it was not printed in
    --list-only mode.
    
    GnuPG-bug-id: 3718
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/mainproc.c b/g10/mainproc.c
index b712e60..512d33c 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -422,7 +422,7 @@ proc_pubkey_enc (ctrl_t ctrl, CTX c, PACKET *pkt)
                        || have_secret_key_with_kid (enc->keyid)))
         {
           if(opt.list_only)
-            result = -1;
+            result = GPG_ERR_MISSING_ACTION; /* fixme: Use better error code. */
           else
             {
               c->dek = xmalloc_secure_clear (sizeof *c->dek);
@@ -440,9 +440,7 @@ proc_pubkey_enc (ctrl_t ctrl, CTX c, PACKET *pkt)
   else
     result = GPG_ERR_PUBKEY_ALGO;
 
-  if (result == -1)
-    ;
-  else
+  if (1)
     {
       /* Store it for later display.  */
       struct kidlist_item *x = xmalloc (sizeof *x);
@@ -510,6 +508,10 @@ print_pkenc_list (ctrl_t ctrl, struct kidlist_item *list, int failed)
               write_status_text (STATUS_NO_SECKEY, buf);
 	    }
 	}
+      else if (gpg_err_code (list->reason) == GPG_ERR_MISSING_ACTION)
+        {
+          /* Not tested for secret key due to --list-only mode.  */
+        }
       else if (list->reason)
         {
           log_info (_("public key decryption failed: %s\n"),

-----------------------------------------------------------------------

Summary of changes:
 g10/mainproc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list