[git] GnuPG - branch, master, updated. gnupg-2.2.7-278-ge955ca2

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Nov 15 06:00:50 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, master has been updated
       via  e955ca245ea08e68ae2397f1583c8728d72acbd8 (commit)
       via  05d163aebc04db109ec5e004eb04a4b3796f6421 (commit)
      from  a5542a4a702c2210facf58a98bc8d3d16089b6ab (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 e955ca245ea08e68ae2397f1583c8728d72acbd8
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Nov 15 13:57:31 2018 +0900

    card: Display UIF setting.
    
    * g10/call-agent.h (agent_card_info_s): Add UIF fields.
    * g10/call-agent.c (learn_status_cb): Put UIF DOs info.
    * g10/card-util.c (current_card_status): Output for UIF.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 2dbacf4..11011ae 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -711,6 +711,17 @@ learn_status_cb (void *opaque, const char *line)
     {
       parm->kdf_do_enabled = 1;
     }
+  else if (keywordlen == 5 && !memcmp (keyword, "UIF-", 4)
+           && strchr("123", keyword[4]))
+    {
+      unsigned char *data;
+      int no = keyword[4] - '1';
+
+      log_assert (no >= 0 && no <= 2);
+      data = unescape_status_string (line);
+      parm->uif[no] = (data[0] != 0xff);
+      xfree (data);
+    }
 
   return 0;
 }
diff --git a/g10/call-agent.h b/g10/call-agent.h
index 1d232f7..8ea8ffe 100644
--- a/g10/call-agent.h
+++ b/g10/call-agent.h
@@ -72,7 +72,8 @@ struct agent_card_info_s
     unsigned int bt:1;     /* Button for confirmation available.  */
   } extcap;
   unsigned int status_indicator;
-  int kdf_do_enabled;      /* Card has a KDF object */
+  int kdf_do_enabled;      /* True if card has a KDF object.  */
+  int uif[3];              /* True if User Interaction Flag is on.  */
 };
 
 
diff --git a/g10/card-util.c b/g10/card-util.c
index 8de061a..eca2484 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -516,6 +516,11 @@ current_card_status (ctrl_t ctrl, estream_t fp,
         {
           es_fprintf (fp, "kdf:%s:\n", info.kdf_do_enabled ? "on" : "off");
         }
+      if (info.extcap.bt)
+        {
+          es_fprintf (fp, "uif:%d:%d:%d:\n",
+                      info.uif[0], info.uif[1], info.uif[2]);
+        }
 
       for (i=0; i < 4; i++)
         {
@@ -627,6 +632,12 @@ current_card_status (ctrl_t ctrl, estream_t fp,
           tty_fprintf (fp, "KDF setting ......: %s\n",
                        info.kdf_do_enabled ? "on" : "off");
         }
+      if (info.extcap.bt)
+        {
+          tty_fprintf (fp, "UIF setting ......: Sign=%s Decrypt=%s Auth=%s\n",
+                       info.uif[0] ? "on" : "off", info.uif[1] ? "on" : "off",
+                       info.uif[2] ? "on" : "off");
+        }
       tty_fprintf (fp, "Signature key ....:");
       print_shax_fpr (fp, info.fpr1len? info.fpr1:NULL, info.fpr1len);
       if (info.fpr1len && info.fpr1time)

commit 05d163aebc04db109ec5e004eb04a4b3796f6421
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.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index bfaac3b..8de061a 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -512,6 +512,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 789b72f..9948c0b 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1833,9 +1833,14 @@ 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");
-  do_getattr (app, ctrl, "UIF-1");
-  do_getattr (app, ctrl, "UIF-2");
-  do_getattr (app, ctrl, "UIF-3");
+  if (app->app_local->extcap.kdf_do)
+    do_getattr (app, ctrl, "KDF");
+  if (app->app_local->extcap.has_button)
+    {
+      do_getattr (app, ctrl, "UIF-1");
+      do_getattr (app, ctrl, "UIF-2");
+      do_getattr (app, ctrl, "UIF-3");
+    }
   if (app->app_local->extcap.private_dos)
     {
       do_getattr (app, ctrl, "PRIVATE-DO-1");

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

Summary of changes:
 g10/call-agent.c  | 11 +++++++++++
 g10/call-agent.h  |  3 ++-
 g10/card-util.c   | 15 +++++++++++++++
 scd/app-openpgp.c | 11 ++++++++---
 4 files changed, 36 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list