[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.11-19-gd4bc805

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Dec 6 09:18:57 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  d4bc8051525a33b28b1e33daf35d79c1d6cd9c41 (commit)
       via  751ff784e5316470f266750d299ae857ad7840d8 (commit)
       via  293001e2c6f0e228ff7f1b6a3e2606ae1370a5d5 (commit)
      from  c5aba093b86e7d69b34ddcf55130f8f21e889b5c (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 d4bc8051525a33b28b1e33daf35d79c1d6cd9c41
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Nov 15 13:31:12 2018 +0900

    scd: Make "learn" report about KDF data object.
    
    * scd/app-openpgp.c (do_learn_status): Report KDF attr.
    * g10/card-util.c (current_card_status): Output KDF for with_colons.
    
    --
    
    Backport of master commit: 05d163aebc04db109ec5e004eb04a4b3796f6421
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index 45ae3dd..13c2445 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -509,6 +509,10 @@ current_card_status (ctrl_t ctrl, estream_t fp,
       es_fprintf (fp, "pinretry:%d:%d:%d:\n",
                   info.chvretry[0], info.chvretry[1], info.chvretry[2]);
       es_fprintf (fp, "sigcount:%lu:::\n", info.sig_counter);
+      if (info.extcap.kdf)
+        {
+          es_fprintf (fp, "kdf:%s:\n", info.kdf_do_enabled ? "on" : "off");
+        }
 
       for (i=0; i < 4; i++)
         {
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 911bd88..fa23fbe 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1827,6 +1827,8 @@ do_learn_status (app_t app, ctrl_t ctrl, unsigned int flags)
   do_getattr (app, ctrl, "CA-FPR");
   do_getattr (app, ctrl, "CHV-STATUS");
   do_getattr (app, ctrl, "SIG-COUNTER");
+  if (app->app_local->extcap.kdf_do)
+    do_getattr (app, ctrl, "KDF");
   if (app->app_local->extcap.private_dos)
     {
       do_getattr (app, ctrl, "PRIVATE-DO-1");

commit 751ff784e5316470f266750d299ae857ad7840d8
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Nov 15 12:19:02 2018 +0900

    card: Display if KDF is enabled or not.
    
    * g10/call-agent.h (kdf_do_enabled): New field.
    * g10/call-agent.c (learn_status_cb): Set kdf_do_enabled if available.
    * g10/card-util.c (current_card_status): Inform the availability.
    
    --
    
    Cherry pick of master commit: a5542a4a702c2210facf58a98bc8d3d16089b6ab
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 6ee82a5..4630506 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -704,6 +704,10 @@ learn_status_cb (void *opaque, const char *line)
       xfree (parm->private_do[no]);
       parm->private_do[no] = unescape_status_string (line);
     }
+  else if (keywordlen == 3 && !memcmp (keyword, "KDF", 3))
+    {
+      parm->kdf_do_enabled = 1;
+    }
 
   return 0;
 }
diff --git a/g10/call-agent.h b/g10/call-agent.h
index 7314ae8..d7f102c 100644
--- a/g10/call-agent.h
+++ b/g10/call-agent.h
@@ -71,6 +71,7 @@ struct agent_card_info_s
     unsigned int kdf:1;    /* KDF object to support PIN hashing available.  */
   } extcap;
   unsigned int status_indicator;
+  int kdf_do_enabled;      /* Card has a KDF object */
 };
 
 
@@ -192,14 +193,14 @@ gpg_error_t agent_keywrap_key (ctrl_t ctrl, int forexport,
 gpg_error_t agent_import_key (ctrl_t ctrl, const char *desc,
                               char **cache_nonce_addr, const void *key,
                               size_t keylen, int unattended, int force,
-			      u32 *keyid, u32 *mainkeyid, int pubkey_algo);
+                              u32 *keyid, u32 *mainkeyid, int pubkey_algo);
 
 /* Receive a key from the agent.  */
 gpg_error_t agent_export_key (ctrl_t ctrl, const char *keygrip,
                               const char *desc, int openpgp_protected,
                               char **cache_nonce_addr,
                               unsigned char **r_result, size_t *r_resultlen,
-			      u32 *keyid, u32 *mainkeyid, int pubkey_algo);
+                              u32 *keyid, u32 *mainkeyid, int pubkey_algo);
 
 /* Delete a key from the agent.  */
 gpg_error_t agent_delete_key (ctrl_t ctrl, const char *hexkeygrip,
diff --git a/g10/card-util.c b/g10/card-util.c
index dc4c0e6..45ae3dd 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -612,6 +612,11 @@ current_card_status (ctrl_t ctrl, estream_t fp,
       tty_fprintf (fp,    "PIN retry counter : %d %d %d\n",
                    info.chvretry[0], info.chvretry[1], info.chvretry[2]);
       tty_fprintf (fp,    "Signature counter : %lu\n", info.sig_counter);
+      if (info.extcap.kdf)
+        {
+          tty_fprintf (fp, "KDF setting ......: %s\n",
+                       info.kdf_do_enabled ? "on" : "off");
+        }
       tty_fprintf (fp, "Signature key ....:");
       print_sha1_fpr (fp, info.fpr1valid? info.fpr1:NULL);
       if (info.fpr1valid && info.fpr1time)

commit 293001e2c6f0e228ff7f1b6a3e2606ae1370a5d5
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Sep 18 09:34:00 2018 +0900

    g10: Fix memory leak for --card-status.
    
    * g10/card-util.c (card_status): Release memory of serial number.
    
    --
    
    Cherry pick of master commit: fe8b6339542f3b1228b5fd56fc710ea3b07a3a2b
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index 52a09b5..dc4c0e6 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -667,7 +667,7 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
 {
   int err;
   strlist_t card_list, sl;
-  char *serialno0;
+  char *serialno0, *serialno1;
   int all_cards = 0;
 
   if (serialno == NULL)
@@ -693,8 +693,6 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
 
   for (sl = card_list; sl; sl = sl->next)
     {
-      char *serialno1;
-
       if (!all_cards && strcmp (serialno, sl->d))
         continue;
 
@@ -715,7 +713,8 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
     }
 
   /* Select the original card again.  */
-  err = agent_scd_serialno (&serialno0, serialno0);
+  err = agent_scd_serialno (&serialno1, serialno0);
+  xfree (serialno1);
 
  leave:
   xfree (serialno0);

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

Summary of changes:
 g10/call-agent.c  |  4 ++++
 g10/call-agent.h  |  5 +++--
 g10/card-util.c   | 16 ++++++++++++----
 scd/app-openpgp.c |  2 ++
 4 files changed, 21 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list