aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorJames Bottomley <[email protected]>2020-06-24 10:44:02 +0000
committerWerner Koch <[email protected]>2020-06-24 10:44:02 +0000
commitf541e1d95a91d4764c7ed0df10c293bfd493dd41 (patch)
treee3f95adda492eae9ed17e23eec75ca7178e233b4 /agent/command.c
parentgpgconf: Fix regression in --launch and --kill from March (diff)
downloadgnupg-f541e1d95a91d4764c7ed0df10c293bfd493dd41.tar.gz
gnupg-f541e1d95a91d4764c7ed0df10c293bfd493dd41.zip
agent: separate out daemon handling infrastructure for reuse
* agent/call-scd.c: Factor re-usable code out to ... * agent/call-daemon.c: new. Store infos in an array to allow for other backend daemons. * agent/Makefile.am (gpg_agent_SOURCES): Add new file. * agent/agent.h: Include assuan.h. (enum daemon_type): New. (opt): Replace scdaemon_program by daemon_program array. Replace scd_local by a array d_local. Change users accordingly. -- The model I'm using for a TPM daemon is the current scdaemon. That includes start and stop handlers plus liveness checks and an assuan socket generator. To avoid massive code duplication (and save me a lot of effort), I've elected to strip this code out of call-scd.c into a generic framework which can then be reused as is by the TPM handling daemon. Signed-off-by: James Bottomley <[email protected]> Co-authored-by: Werner Koch <[email protected]> Modified original patch for 2.2 heavily to fit the new framework used in master (gnupg 2.3) Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/command.c b/agent/command.c
index 0430745e4..689507bbc 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -3257,7 +3257,7 @@ cmd_getinfo (assuan_context_t ctx, char *line)
}
else if (!strcmp (line, "scd_running"))
{
- rc = agent_scd_check_running ()? 0 : gpg_error (GPG_ERR_FALSE);
+ rc = agent_daemon_check_running (DAEMON_SCD)? 0:gpg_error (GPG_ERR_FALSE);
}
else if (!strcmp (line, "std_env_names"))
{
@@ -3747,7 +3747,7 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
clear_nonce_cache (ctrl);
/* Reset the SCD if needed. */
- agent_reset_scd (ctrl);
+ agent_reset_daemon (ctrl);
/* Reset the pinentry (in case of popup messages). */
agent_reset_query (ctrl);