diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-07-19 06:26:49 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-07-19 06:26:49 +0200 |
commit | 98f4eff7ffde106ae4f60739d1104282430ac14f (patch) | |
tree | 9081ccd95ce9027221d9a31bc605407f92ed4472 /g10/call-agent.c | |
parent | scd: Support "[CHV3]" attribute for keyid string. (diff) | |
download | gnupg2-98f4eff7ffde106ae4f60739d1104282430ac14f.tar.xz gnupg2-98f4eff7ffde106ae4f60739d1104282430ac14f.zip |
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 <gniibe@fsij.org>
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 19deb73d7..d55238311 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -740,7 +740,15 @@ learn_status_cb (void *opaque, const char *line) } 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); } else if (keywordlen == 5 && !memcmp (keyword, "UIF-", 4) && strchr("123", keyword[4])) |