[git] GnuPG - branch, master, updated. gnupg-2.1.21-48-g7aeac20

by Neal H. Walfield cvs at cvs.gnupg.org
Sun Jun 11 14:12:41 CEST 2017


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, master has been updated
       via  7aeac20f12ed257d3d159b304afeeac7f406c9d2 (commit)
       via  cb0484e0762a1ce05d00d949f4b70162e2f7b82c (commit)
       via  4ddf4e114c8df06d89144e857b7601de0b7e5a7c (commit)
       via  8a9066865688cf17594b2bdde4b260b0ef36d68e (commit)
      from  bc5503b2bf273b51d5dc59617e596f1cfb742fbc (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 7aeac20f12ed257d3d159b304afeeac7f406c9d2
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Jun 11 14:10:46 2017 +0200

    gpg: Send gpgcompose --help output to stdout, not stderr.
    
    * g10/gpgcompose.c (show_help): Send gpgcompose --help output to
    stdout, not stderr.
    
    Reported-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index 98c04f2..8e29c2f 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -281,18 +281,18 @@ show_help (struct option options[])
         {
           const char *o = option[0] ? option : "ARG";
           l = strlen (o);
-          fprintf (stderr, "%s", o);
+          fprintf (stdout, "%s", o);
         }
 
       if (! help)
         {
-          fputc ('\n', stderr);
+          fputc ('\n', stdout);
           continue;
         }
 
       if (option)
         for (j = l; j < max_length + 2; j ++)
-          fputc (' ', stderr);
+          fputc (' ', stdout);
 
 #define BOLD_START "\033[1m"
 #define NORMAL_RESTORE "\033[0m"
@@ -314,7 +314,7 @@ show_help (struct option options[])
 
       if (! option)
         {
-          fprintf (stderr, "\n%s\n", formatted);
+          printf ("\n%s\n", formatted);
           break;
         }
 
@@ -330,10 +330,10 @@ show_help (struct option options[])
 
           if (p != formatted)
             for (j = 0; j < max_length + 2; j ++)
-              fputc (' ', stderr);
+              fputc (' ', stdout);
 
-          fwrite (p, l, 1, stderr);
-          fputc ('\n', stderr);
+          fwrite (p, l, 1, stdout);
+          fputc ('\n', stdout);
         }
 
       xfree (formatted);

commit cb0484e0762a1ce05d00d949f4b70162e2f7b82c
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Jun 11 14:07:02 2017 +0200

    gpg: Improve some output of gpgcompose.

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index 49bb8af..98c04f2 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -512,7 +512,8 @@ static struct option major_options[] = {
   { "--encrypted-mdc", encrypted,
     "Create a symmetrically encrypted and integrity protected data packet." },
   { "--encrypted-pop", encrypted_pop,
-    "Pop an encryption container." },
+    "Pop the most recent encryption container started by either"
+    " --encrypted or --encrypted-mdc." },
   { "--compressed", NULL, "Create a compressed data packet." },
   { "--literal", literal, "Create a literal (plaintext) data packet." },
   { "--signature", signature, "Create a signature packet." },
@@ -2534,7 +2535,9 @@ encrypted (const char *option, int argc, char *argv[], void *cookie)
                                argc, argv);
 
   if (! session_key.algo)
-    log_fatal ("%s: no session key configured.\n", option);
+    log_fatal ("%s: no session key configured\n"
+               "  (use e.g. --sk-esk PASSWORD or --pk-esk KEYID).\n",
+               option);
 
   memset (&e, 0, sizeof (e));
   /* We only need to set E->LEN, E->EXTRALEN (if E->LEN is not

commit 4ddf4e114c8df06d89144e857b7601de0b7e5a7c
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Jun 11 14:00:22 2017 +0200

    gpg: Support 'gpgcompose --encrypted-pop --help'
    
    * g10/gpgcompose.c (encrypted_pop_options): New variable.
    (encrypted_pop): Support the --help option.
    
    Reported-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index a8da54c..49bb8af 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -2580,18 +2580,36 @@ encrypted (const char *option, int argc, char *argv[], void *cookie)
   return processed;
 }
 

+static struct option encrypted_pop_options[] = {
+  { NULL, NULL,
+    "Example:\n\n"
+    "  $ gpgcompose --sk-esk PASSWORD \\\n"
+    "    --encrypted-mdc \\\n"
+    "      --literal --value foo \\\n"
+    "    --encrypted-pop | " GPG_NAME " --list-packets" }
+};
+
 static int
 encrypted_pop (const char *option, int argc, char *argv[], void *cookie)
 {
   iobuf_t out = cookie;
+  int processed;
 
-  (void) argc;
-  (void) argv;
+  processed = process_options (option,
+                               major_options,
+                               encrypted_pop_options,
+                               NULL,
+                               global_options, NULL,
+                               argc, argv);
+  /* We only support a single option, --help, which causes the program
+   * to exit.  */
+  log_assert (processed == 0);
 
+  filter_pop (out, PKT_ENCRYPTED);
 
   debug ("Popped encryption container.\n");
 
-  return 0;
+  return processed;
 }
 

 struct data

commit 8a9066865688cf17594b2bdde4b260b0ef36d68e
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Jun 11 13:58:44 2017 +0200

    gpg: Remove dead code.
    
    * g10/gpgcompose.c (filter_pop): F->PKTTYPE will never be
    PKT_ENCRYPTED_MDC.
    (encrypted_pop): Likewise and there is no option --encrypted-mdc-pop.

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index e541cfe..a8da54c 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -81,7 +81,7 @@ filter_pop (iobuf_t out, int expected_type)
                "but current container is a %s container.\n",
                pkttype_str (f->pkttype), pkttype_str (expected_type));
 
-  if (f->pkttype == PKT_ENCRYPTED || f->pkttype == PKT_ENCRYPTED_MDC)
+  if (f->pkttype == PKT_ENCRYPTED)
     {
       err = iobuf_pop_filter (out, f->func, f->context);
       if (err)
@@ -2588,12 +2588,6 @@ encrypted_pop (const char *option, int argc, char *argv[], void *cookie)
   (void) argc;
   (void) argv;
 
-  if (strcmp (option, "--encrypted-pop") == 0)
-    filter_pop (out, PKT_ENCRYPTED);
-  else if (strcmp (option, "--encrypted-mdc-pop") == 0)
-    filter_pop (out, PKT_ENCRYPTED_MDC);
-  else
-    log_fatal ("%s: option not handled by this function!\n", option);
 
   debug ("Popped encryption container.\n");
 

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

Summary of changes:
 g10/gpgcompose.c | 53 ++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 19 deletions(-)


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




More information about the Gnupg-commits mailing list