summaryrefslogtreecommitdiffstats
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-04-03 10:00:57 +0200
committerWerner Koch <wk@gnupg.org>2020-04-03 10:44:32 +0200
commit15352b0eac335e7993fcd7720106a3a7d22caae1 (patch)
treef8b1f0e63571b66ae293e19e3a291a2b71668e71 /g10/call-agent.c
parentscd:openpgp: New attribute "MANUFACTURER". (diff)
downloadgnupg2-15352b0eac335e7993fcd7720106a3a7d22caae1.tar.xz
gnupg2-15352b0eac335e7993fcd7720106a3a7d22caae1.zip
gpg,card: Use the new MANUFACTURER attribute.
* tools/gpg-card.h (struct card_info_s): Add manufacturer fields. * tools/card-call-scd.c (release_card_info): Release them. (learn_status_cb): Parse MANUFACTURER attribute. * tools/gpg-card.c (get_manufacturer): Remove. (list_card): Use the new attribute. * g10/call-agent.h (struct agent_card_info_s): Add manufacturer fields. * g10/call-agent.c (agent_release_card_info): Release them. (learn_status_cb): Parse MANUFACTURER attribute. * g10/card-util.c (get_manufacturer): Remove. (current_card_status): Use new attribute. -- This does away with the duplicated OpenPGP vendor tables; they are now at a better place (app-openpgp.c). Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r--g10/call-agent.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 98d965cbe..5c6a4a66d 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -517,6 +517,7 @@ agent_release_card_info (struct agent_card_info_s *info)
return;
xfree (info->reader); info->reader = NULL;
+ xfree (info->manufacturer_name); info->manufacturer_name = NULL;
xfree (info->serialno); info->serialno = NULL;
xfree (info->apptype); info->apptype = NULL;
xfree (info->disp_name); info->disp_name = NULL;
@@ -540,6 +541,7 @@ learn_status_cb (void *opaque, const char *line)
const char *keyword = line;
int keywordlen;
int i;
+ char *endp;
for (keywordlen=0; *line && !spacep (line); line++, keywordlen++)
;
@@ -741,6 +743,16 @@ learn_status_cb (void *opaque, const char *line)
xfree (parm->private_do[no]);
parm->private_do[no] = unescape_status_string (line);
}
+ else if (keywordlen == 12 && !memcmp (keyword, "MANUFACTURER", 12))
+ {
+ xfree (parm->manufacturer_name);
+ parm->manufacturer_name = NULL;
+ parm->manufacturer_id = strtoul (line, &endp, 0);
+ while (endp && spacep (endp))
+ endp++;
+ if (endp && *endp)
+ parm->manufacturer_name = xstrdup (endp);
+ }
else if (keywordlen == 3 && !memcmp (keyword, "KDF", 3))
{
unsigned char *data = unescape_status_string (line);