[git] GnuPG - branch, master, updated. gnupg-2.1.9-128-g2038adf

by Werner Koch cvs at cvs.gnupg.org
Thu Nov 12 17:07:52 CET 2015


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  2038adf16d0e7eeb614043aae17b16a867de6b70 (commit)
      from  e3c48335f9c5081c6080bceafa7a04140403427a (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 2038adf16d0e7eeb614043aae17b16a867de6b70
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Nov 12 17:02:18 2015 +0100

    gpg: Print a new EXPORTED status line.
    
    * common/status.h (STATUS_EXPORTED): New.
    * g10/export.c (print_status_exported): New.
    (do_export_stream): Call that function.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/status.h b/common/status.h
index 3409167..71bcc95 100644
--- a/common/status.h
+++ b/common/status.h
@@ -62,6 +62,7 @@ enum
     STATUS_IMPORT_RES,
     STATUS_IMPORT_CHECK,
 
+    STATUS_EXPORTED,
     STATUS_EXPORT_RES,
 
     STATUS_FILE_START,
diff --git a/doc/DETAILS b/doc/DETAILS
index aa5a57b..7c3e67c 100644
--- a/doc/DETAILS
+++ b/doc/DETAILS
@@ -768,6 +768,11 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
     - <not_imported>
     - <skipped_v3_keys>
 
+*** EXPORTED  <fingerprint>
+    The key with <fingerprint> has been exported.  The fingerprint is
+    the fingerprint of the primary key even if the primary key has
+    been replaced by a stub key during secret key export.
+
 *** EXPORT_RES <args>
 
     Final statistics on export process (this is one long line). The
diff --git a/g10/export.c b/g10/export.c
index d84ff74..b927251 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -809,6 +809,22 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
   goto leave;
 }
 
+
+/* Print an "EXPORTED" status line.  PK is the primary public key.  */
+static void
+print_status_exported (PKT_public_key *pk)
+{
+  char *hexfpr;
+
+  if (!is_status_enabled ())
+    return;
+
+  hexfpr = hexfingerprint (pk);
+  write_status_text (STATUS_EXPORTED, hexfpr? hexfpr : "[?]");
+  xfree (hexfpr);
+}
+
+
 /* Export the keys identified by the list of strings in USERS to the
    stream OUT.  If Secret is false public keys will be exported.  With
    secret true secret keys will be exported; in this case 1 means the
@@ -1182,7 +1198,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
 
                   err = build_packet (out, node->pkt);
                   if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
-                    stats->exported++;
+                    {
+                      stats->exported++;
+                      print_status_exported (node->pkt->pkt.public_key);
+                    }
                 }
               else if (!err)
                 {
@@ -1239,7 +1258,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
 
                   err = build_packet (out, node->pkt);
                   if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
-                    stats->exported++;
+                    {
+                      stats->exported++;
+                      print_status_exported (node->pkt->pkt.public_key);
+                    }
                   goto unwraperror_leave;
 
                 unwraperror:
@@ -1278,7 +1300,10 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
             {
               err = build_packet (out, node->pkt);
               if (!err && node->pkt->pkttype == PKT_PUBLIC_KEY)
-                stats->exported++;
+                {
+                  stats->exported++;
+                  print_status_exported (node->pkt->pkt.public_key);
+                }
             }
 
 

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

Summary of changes:
 common/status.h |  1 +
 doc/DETAILS     |  5 +++++
 g10/export.c    | 31 ++++++++++++++++++++++++++++---
 3 files changed, 34 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list