aboutsummaryrefslogtreecommitdiffstats
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-03-23 08:06:20 +0000
committerWerner Koch <[email protected]>2018-03-23 08:06:20 +0000
commit2cd35df5db3c4dfe37616dcfb1fcc644959449ef (patch)
tree9eeb212cd74e905e5d43eaf6b98f8189989111a6 /g10/call-agent.c
parentagent: New OPTION pretend-request-origin (diff)
downloadgnupg-2cd35df5db3c4dfe37616dcfb1fcc644959449ef.tar.gz
gnupg-2cd35df5db3c4dfe37616dcfb1fcc644959449ef.zip
gpg,sm: New option --request-origin.
* g10/gpg.c (oRequestOrigin): New const. (opts): New option --request-origin. (main): Parse that option. * g10/options.h (struct opt): Add field request_origin. * g10/call-agent.c (start_agent): Send option to the agent. * sm/gpgsm.c (oRequestOrigin): New const. (opts): New option --request-origin. (main): Parse that option. * sm/gpgsm.h (struct opt): Add field request_origin. * sm/call-agent.c (start_agent): Send option to the agent. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--g10/call-agent.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index fdacf6a90..6ee82a5a4 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