summaryrefslogtreecommitdiff
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:33 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:33 +0900
commit7a22f5e8cd3e5a40c2a3a8e87a95bd98a64e7cb2 (patch)
tree869d29746d3e966b0f25816b291a32306e2c7446 /g10/call-agent.c
parent435d1f5256782583b8b427cd7b07f71dca58b6bd (diff)
downloadgpg2-7a22f5e8cd3e5a40c2a3a8e87a95bd98a64e7cb2.tar.gz
gpg2-7a22f5e8cd3e5a40c2a3a8e87a95bd98a64e7cb2.tar.bz2
gpg2-7a22f5e8cd3e5a40c2a3a8e87a95bd98a64e7cb2.zip
Imported Upstream version 2.2.6upstream/2.2.6
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r--g10/call-agent.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 545b244..6ee82a5 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -289,6 +289,23 @@ start_agent (ctrl_t ctrl, int flag_for_card)
}
}
+ /* Pass on the request origin. */
+ if (opt.request_origin)
+ {
+ char *tmp = xasprintf ("OPTION pretend-request-origin=%s",
+ str_request_origin (opt.request_origin));
+ rc = assuan_transact (agent_ctx, tmp,
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ xfree (tmp);
+ if (rc)
+ {
+ log_error ("setting request origin '%s' failed: %s\n",
+ str_request_origin (opt.request_origin),
+ gpg_strerror (rc));
+ write_status_error ("set_request_origin", rc);
+ }
+ }
+
/* In DE_VS mode under Windows we require that the JENT RNG
* is active. */
#ifdef HAVE_W32_SYSTEM
@@ -381,10 +398,11 @@ unhexify_fpr (const char *hexstr, unsigned char *fpr)
for (s=hexstr, n=0; hexdigitp (s); s++, n++)
;
- if (*s || (n != 40))
+ if ((*s && *s != ' ') || (n != 40))
return 0; /* no fingerprint (invalid or wrong length). */
- for (s=hexstr, n=0; *s; s += 2, n++)
+ for (s=hexstr, n=0; *s && n < 20; s += 2, n++)
fpr[n] = xtoi_2 (s);
+
return 1; /* okay */
}
@@ -590,6 +608,8 @@ learn_status_cb (void *opaque, const char *line)
parm->extcap.ki = abool;
else if (!strcmp (p, "aac"))
parm->extcap.aac = abool;
+ else if (!strcmp (p, "kdf"))
+ parm->extcap.kdf = abool;
else if (!strcmp (p, "si"))
parm->status_indicator = strtoul (p2, NULL, 10);
}
@@ -625,6 +645,24 @@ learn_status_cb (void *opaque, const char *line)
else if (no == 3)
parm->fpr3time = strtoul (line, NULL, 10);
}
+ else if (keywordlen == 11 && !memcmp (keyword, "KEYPAIRINFO", keywordlen))
+ {
+ const char *hexgrp = line;
+ int no;
+
+ while (*line && !spacep (line))
+ line++;
+ while (spacep (line))
+ line++;
+ if (strncmp (line, "OPENPGP.", 8))
+ ;
+ else if ((no = atoi (line+8)) == 1)
+ unhexify_fpr (hexgrp, parm->grp1);
+ else if (no == 2)
+ unhexify_fpr (hexgrp, parm->grp2);
+ else if (no == 3)
+ unhexify_fpr (hexgrp, parm->grp3);
+ }
else if (keywordlen == 6 && !memcmp (keyword, "CA-FPR", keywordlen))
{
int no = atoi (line);