mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-24 16:43:28 +02:00
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. -- Backport master commit of: 98f4eff7ffde106ae4f60739d1104282430ac14f Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
b21133ba80
commit
8e01676981
@ -706,7 +706,15 @@ learn_status_cb (void *opaque, const char *line)
|
|||||||
}
|
}
|
||||||
else if (keywordlen == 3 && !memcmp (keyword, "KDF", 3))
|
else if (keywordlen == 3 && !memcmp (keyword, "KDF", 3))
|
||||||
{
|
{
|
||||||
parm->kdf_do_enabled = 1;
|
unsigned char *data = unescape_status_string (line);
|
||||||
|
|
||||||
|
if (data[2] != 0x03)
|
||||||
|
parm->kdf_do_enabled = 0;
|
||||||
|
else if (data[22] != 0x85)
|
||||||
|
parm->kdf_do_enabled = 1;
|
||||||
|
else
|
||||||
|
parm->kdf_do_enabled = 2;
|
||||||
|
xfree (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -71,7 +71,7 @@ struct agent_card_info_s
|
|||||||
unsigned int kdf:1; /* KDF object to support PIN hashing available. */
|
unsigned int kdf:1; /* KDF object to support PIN hashing available. */
|
||||||
} extcap;
|
} extcap;
|
||||||
unsigned int status_indicator;
|
unsigned int status_indicator;
|
||||||
int kdf_do_enabled; /* Card has a KDF object */
|
int kdf_do_enabled; /* Non-zero if card has a KDF object, 0 if not. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -511,7 +511,16 @@ current_card_status (ctrl_t ctrl, estream_t fp,
|
|||||||
es_fprintf (fp, "sigcount:%lu:::\n", info.sig_counter);
|
es_fprintf (fp, "sigcount:%lu:::\n", info.sig_counter);
|
||||||
if (info.extcap.kdf)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i < 4; i++)
|
for (i=0; i < 4; i++)
|
||||||
@ -618,8 +627,16 @@ current_card_status (ctrl_t ctrl, estream_t fp,
|
|||||||
tty_fprintf (fp, "Signature counter : %lu\n", info.sig_counter);
|
tty_fprintf (fp, "Signature counter : %lu\n", info.sig_counter);
|
||||||
if (info.extcap.kdf)
|
if (info.extcap.kdf)
|
||||||
{
|
{
|
||||||
tty_fprintf (fp, "KDF setting ......: %s\n",
|
const char *setup;
|
||||||
info.kdf_do_enabled ? "on" : "off");
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
tty_fprintf (fp, "Signature key ....:");
|
tty_fprintf (fp, "Signature key ....:");
|
||||||
print_sha1_fpr (fp, info.fpr1valid? info.fpr1:NULL);
|
print_sha1_fpr (fp, info.fpr1valid? info.fpr1:NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user