[git] GnuPG - branch, master, updated. gnupg-2.1.12-53-g7257ea2

by Werner Koch cvs at cvs.gnupg.org
Mon Jun 6 17:06:36 CEST 2016


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  7257ea2d450238afa4d162fab8001f74782fe43f (commit)
       via  1d1cb86694fb2223de1da0b3bfffb5c62f505847 (commit)
      from  b047388d57443f584f1c1d6333aac5218b685042 (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 7257ea2d450238afa4d162fab8001f74782fe43f
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jun 6 17:03:47 2016 +0200

    gpg: Use --keyid-format=none by default.
    
    * g10/gpg.c (main): Init keyid_format to KF_NONE.
    * g10/keyid.c (format_keyid): Ditto.
    (keystrlen): Ditto.
    --
    
    GnuPG-bug-id: 2379
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/gpg.c b/g10/gpg.c
index 5b4fba6..df6c246 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -2249,7 +2249,7 @@ main (int argc, char **argv)
     opt.mangle_dos_filenames = 0;
     opt.min_cert_level = 2;
     set_screen_dimensions ();
-    opt.keyid_format = KF_SHORT;
+    opt.keyid_format = KF_NONE;
     opt.def_sig_expire = "0";
     opt.def_cert_expire = "0";
     set_homedir (default_homedir ());
diff --git a/g10/keyid.c b/g10/keyid.c
index 4cdc41d..e67f67f 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -333,7 +333,7 @@ format_keyid (u32 *keyid, int format, char *buffer, int len)
   if (format == KF_DEFAULT)
     format = opt.keyid_format;
   if (format == KF_DEFAULT)
-    format = KF_SHORT;
+    format = KF_NONE;
 
   switch (format)
     {
@@ -380,7 +380,7 @@ keystrlen(void)
 {
   int format = opt.keyid_format;
   if (format == KF_DEFAULT)
-    format = KF_SHORT;
+    format = KF_NONE;
 
   switch(format)
     {

commit 1d1cb86694fb2223de1da0b3bfffb5c62f505847
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jun 6 16:55:03 2016 +0200

    gpg: Add option --with-subkey-fingerprint.
    
    * g10/gpg.c (oWithSubkeyFingerprint): New.
    (opts): Add --with-subkey-fingerprint[s].
    (main): Set that option.
    * g10/options.h (struct opt): Add 'with_subkey_fingerprint'.
    * g10/keylist.c (list_keyblock_print): Print subkey fingerprint.
    (print_fingerprint): Tweak printing to use compact format if
    desirable.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpg.texi b/doc/gpg.texi
index f190581..f092b27 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -342,7 +342,8 @@ fingerprints. This is the same output as @option{--list-keys} but with
 the additional output of a line with the fingerprint. May also be
 combined with @option{--list-sigs} or @option{--check-sigs}.  If this
 command is given twice, the fingerprints of all secondary keys are
-listed too.
+listed too.  This command also forces pretty printing of fingerprints
+if the keyid format has been set to "none".
 
 @item --list-packets
 @opindex list-packets
@@ -2276,6 +2277,14 @@ allow to convey suitable information for elliptic curves.
 Same as the command @option{--fingerprint} but changes only the format
 of the output and may be used together with another command.
 
+ at item --with-subkey-fingerprint
+ at opindex with-subkey-fingerprint
+If a fingerprint is printed for the primary key, this option forces
+printing of the fingerprint for all subkeys.  This could also be
+achieved by using the @option{--with-fingerprint} twice but by using
+this option along with keyid-format "none" a compact fingerprint is
+printed.
+
 @item --with-icao-spelling
 @opindex with-icao-spelling
 Print the ICAO spelling of the fingerprint in addition to the hex digits.
diff --git a/g10/gpg.c b/g10/gpg.c
index d0be4ba..5b4fba6 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -182,6 +182,7 @@ enum cmd_and_opt_values
     oNoAskCertLevel,
     oFingerprint,
     oWithFingerprint,
+    oWithSubkeyFingerprint,
     oWithICAOSpelling,
     oWithKeygrip,
     oWithSecret,
@@ -720,6 +721,8 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_n (oUtf8Strings,      "utf8-strings", "@"),
   ARGPARSE_s_n (oNoUtf8Strings, "no-utf8-strings", "@"),
   ARGPARSE_s_n (oWithFingerprint, "with-fingerprint", "@"),
+  ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprint", "@"),
+  ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprints", "@"),
   ARGPARSE_s_n (oWithICAOSpelling, "with-icao-spelling", "@"),
   ARGPARSE_s_n (oWithKeygrip,     "with-keygrip", "@"),
   ARGPARSE_s_n (oWithSecret,      "with-secret", "@"),
@@ -2566,6 +2569,9 @@ main (int argc, char **argv)
             opt.with_fingerprint = 1;
             opt.fingerprint++;
             break;
+	  case oWithSubkeyFingerprint:
+            opt.with_subkey_fingerprint = 1;
+            break;
 	  case oWithICAOSpelling:
             opt.with_icao_spelling = 1;
             break;
diff --git a/g10/keyid.c b/g10/keyid.c
index 20efa01..4cdc41d 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -384,6 +384,9 @@ keystrlen(void)
 
   switch(format)
     {
+    case KF_NONE:
+      return 0;
+
     case KF_SHORT:
       return 8;
 
diff --git a/g10/keylist.c b/g10/keylist.c
index abd5ffa..231f3c0 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -1168,7 +1168,7 @@ list_keyblock_print (ctrl_t ctrl, kbnode_t keyblock, int secret, int fpr,
 
           /* Print the "sub" line.  */
           print_key_line (es_stdout, pk2, secret);
-	  if (fpr > 1)
+	  if (fpr > 1 || opt.with_subkey_fingerprint)
             {
               print_fingerprint (NULL, pk2, 0);
               if (serialno)
@@ -1821,6 +1821,10 @@ print_fingerprint (estream_t override_fp, PKT_public_key *pk, int mode)
       compact = 1;
     }
 
+  if (!opt.fingerprint && !opt.with_fingerprint
+      && opt.with_subkey_fingerprint && opt.keyid_format == KF_NONE)
+    compact = 1;
+
   if (pk->main_keyid[0] == pk->keyid[0]
       && pk->main_keyid[1] == pk->keyid[1])
     primary = 1;
@@ -1873,7 +1877,13 @@ print_fingerprint (estream_t override_fp, PKT_public_key *pk, int mode)
   else
     {
       fp = override_fp? override_fp : es_stdout;
-      text = _("      Key fingerprint =");
+      if (opt.keyid_format == KF_NONE)
+        {
+          text = "     ";  /* To indent ICAO spelling.  */
+          compact = 1;
+        }
+      else
+        text = _("      Key fingerprint =");
     }
 
   hexfingerprint (pk, hexfpr, sizeof hexfpr);
@@ -1881,7 +1891,7 @@ print_fingerprint (estream_t override_fp, PKT_public_key *pk, int mode)
     {
       es_fprintf (fp, "fpr:::::::::%s:", hexfpr);
     }
-  else if (compact)
+  else if (compact && !opt.fingerprint && !opt.with_fingerprint)
     {
       tty_fprintf (fp, "%*s%s", 6, "", hexfpr);
     }
@@ -1889,7 +1899,10 @@ print_fingerprint (estream_t override_fp, PKT_public_key *pk, int mode)
     {
       char fmtfpr[MAX_FORMATTED_FINGERPRINT_LEN + 1];
       format_hexfingerprint (hexfpr, fmtfpr, sizeof fmtfpr);
-      tty_fprintf (fp, "%s %s", text, fmtfpr);
+      if (compact)
+        tty_fprintf (fp, "%*s%s", 6, "", fmtfpr);
+      else
+        tty_fprintf (fp, "%s %s", text, fmtfpr);
     }
   tty_fprintf (fp, "\n");
   if (!with_colons && with_icao)
diff --git a/g10/options.h b/g10/options.h
index 55f974a..2ae1724 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -71,6 +71,7 @@ struct
   int with_key_data;
   int with_icao_spelling; /* Print ICAO spelling with fingerprints.  */
   int with_fingerprint; /* Option --with-fingerprint active.  */
+  int with_subkey_fingerprint; /* Option --with-subkey-fingerprint active.  */
   int with_keygrip;     /* Option --with-keygrip active.  */
   int with_secret;      /* Option --with-secret active.  */
   int with_wkd_hash;    /* Option --with-wkd-hash.  */

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

Summary of changes:
 doc/gpg.texi  | 11 ++++++++++-
 g10/gpg.c     |  8 +++++++-
 g10/keyid.c   |  7 +++++--
 g10/keylist.c | 21 +++++++++++++++++----
 g10/options.h |  1 +
 5 files changed, 40 insertions(+), 8 deletions(-)


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




More information about the Gnupg-commits mailing list