1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

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@fsij.org>
This commit is contained in:
NIIBE Yutaka 2018-11-15 13:57:31 +09:00
parent 05d163aebc
commit e955ca245e
3 changed files with 24 additions and 1 deletions

View File

@ -711,6 +711,17 @@ learn_status_cb (void *opaque, const char *line)
{ {
parm->kdf_do_enabled = 1; 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; return 0;
} }

View File

@ -72,7 +72,8 @@ struct agent_card_info_s
unsigned int bt:1; /* Button for confirmation available. */ unsigned int bt:1; /* Button for confirmation available. */
} extcap; } extcap;
unsigned int status_indicator; 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. */
}; };

View File

@ -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"); 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++) 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", tty_fprintf (fp, "KDF setting ......: %s\n",
info.kdf_do_enabled ? "on" : "off"); 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 ....:"); tty_fprintf (fp, "Signature key ....:");
print_shax_fpr (fp, info.fpr1len? info.fpr1:NULL, info.fpr1len); print_shax_fpr (fp, info.fpr1len? info.fpr1:NULL, info.fpr1len);
if (info.fpr1len && info.fpr1time) if (info.fpr1len && info.fpr1time)