scd: Make "learn" report about KDF data object.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Nov 2018 04:31:12 +0000 (13:31 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Nov 2018 04:56:27 +0000 (13:56 +0900)
* 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@fsij.org>
g10/card-util.c
scd/app-openpgp.c

index bfaac3b..8de061a 100644 (file)
@@ -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++)
         {
index 789b72f..9948c0b 100644 (file)
@@ -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");