[git] GnuPG - branch, master, updated. gnupg-2.1.12-48-g8d976a6

by Werner Koch cvs at cvs.gnupg.org
Thu Jun 2 22:03:22 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  8d976a6b07c5a356631791b46b590328c1451f31 (commit)
      from  1b460f049e5c1c102d8b55ad28781688252c5a6b (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 8d976a6b07c5a356631791b46b590328c1451f31
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jun 2 22:01:51 2016 +0200

    gpg: Add the fingerprint to KEY_CREATED for subkeys.
    
    * g10/keygen.c (print_status_key_created): Make more robust by
    allowing a NULL for PK.
    (generate_subkeypair): Use print_status_key_created.
    (generate_card_subkeypair): Ditto.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/keygen.c b/g10/keygen.c
index c8057b5..a4a3110 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -166,11 +166,14 @@ print_status_key_created (int letter, PKT_public_key *pk, const char *handle)
   if (letter || pk)
     {
       *p++ = letter;
-      *p++ = ' ';
-      fingerprint_from_pk (pk, array, &n);
-      s = array;
-      for (i=0; i < n ; i++, s++, p += 2)
-        sprintf (p, "%02X", *s);
+      if (pk)
+        {
+          *p++ = ' ';
+          fingerprint_from_pk (pk, array, &n);
+          s = array;
+          for (i=0; i < n ; i++, s++, p += 2)
+            sprintf (p, "%02X", *s);
+        }
     }
   if (*handle)
     {
@@ -4662,7 +4665,8 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock, const char *algostr,
   if (err)
     goto leave;
 
-  write_status_text (STATUS_KEY_CREATED, "S");
+  print_status_key_created ('S', sub_psk, NULL);
+
 
  leave:
   xfree (key_from_hexgrip);
@@ -4691,6 +4695,7 @@ generate_card_subkeypair (kbnode_t pub_keyblock,
   u32 expire;
   u32 cur_time;
   struct para_data_s *para = NULL;
+  PKT_public_key *sub_pk = NULL;
 
   log_assert (keyno >= 1 && keyno <= 3);
 
@@ -4757,8 +4762,6 @@ generate_card_subkeypair (kbnode_t pub_keyblock,
   /* Get the pointer to the generated public subkey packet.  */
   if (!err)
     {
-      PKT_public_key *sub_pk = NULL;
-
       for (node = pub_keyblock; node; node = node->next)
         if (node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
           sub_pk = node->pkt->pkt.public_key;
@@ -4771,7 +4774,7 @@ generate_card_subkeypair (kbnode_t pub_keyblock,
   if (err)
     log_error (_("Key generation failed: %s\n"), gpg_strerror (err) );
   else
-    write_status_text (STATUS_KEY_CREATED, "S");
+    print_status_key_created ('S', sub_pk, NULL);
   release_parameter_list (para);
   return err;
 }

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

Summary of changes:
 g10/keygen.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)


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




More information about the Gnupg-commits mailing list