From 98f4eff7ffde106ae4f60739d1104282430ac14f Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 19 Jul 2019 13:26:49 +0900 Subject: card: Fix showing KDF object attribute. * g10/call-agent.c (learn_status_cb): Parse the KDF DO. * g10/card-util.c (current_card_status): Show it correctly. Signed-off-by: NIIBE Yutaka --- g10/card-util.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'g10/card-util.c') diff --git a/g10/card-util.c b/g10/card-util.c index a95cc121a..fbb941915 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -521,7 +521,16 @@ current_card_status (ctrl_t ctrl, estream_t fp, 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"); + const char *setup; + + if (info.kdf_do_enabled == 0) + setup = "off"; + else if (info.kdf_do_enabled == 1) + setup = "single"; + else + setup = "on"; + + es_fprintf (fp, "kdf:%s:\n", setup); } if (info.extcap.bt) { @@ -636,8 +645,16 @@ current_card_status (ctrl_t ctrl, estream_t fp, 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"); + const char *setup; + + if (info.kdf_do_enabled == 0) + setup = "off"; + else if (info.kdf_do_enabled == 1) + setup = "single"; + else + setup = "on"; + + tty_fprintf (fp, "KDF setting ......: %s\n", setup); } if (info.extcap.bt) { -- cgit v1.2.3