aboutsummaryrefslogtreecommitdiffstats
path: root/sm/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-09-30 10:30:20 +0000
committerWerner Koch <[email protected]>2008-09-30 10:30:20 +0000
commit8381a43ca7cb277f70c3c91d66a7cf890b96ffb9 (patch)
treeaef47b3f1a7c1d3f9623afad0e8e0000a2b356dd /sm/call-agent.c
parentRemove hacks which are not anymore needed since we now require Libgcrypt 1.4 (diff)
downloadgnupg-8381a43ca7cb277f70c3c91d66a7cf890b96ffb9.tar.gz
gnupg-8381a43ca7cb277f70c3c91d66a7cf890b96ffb9.zip
Add gpgsm server command GETINFO agent-check.
Fix tests.
Diffstat (limited to 'sm/call-agent.c')
-rw-r--r--sm/call-agent.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c
index 625ca9d6e..d1dad6d07 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -328,7 +328,7 @@ gpgsm_agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
{
int rc;
char line[ASSUAN_LINELENGTH];
- membuf_t data;
+ membuf_t data;
struct cipher_parm_s cipher_parm;
size_t n, len;
char *p, *buf, *endp;
@@ -802,3 +802,21 @@ gpgsm_agent_get_confirmation (ctrl_t ctrl, const char *desc)
default_inq_cb, ctrl, NULL, NULL);
return rc;
}
+
+
+
+/* Return 0 if the agent is alive. This is useful to make sure that
+ an agent has been started. */
+gpg_error_t
+gpgsm_agent_send_nop (ctrl_t ctrl)
+{
+ int rc;
+
+ rc = start_agent (ctrl);
+ if (!rc)
+ rc = assuan_transact (agent_ctx, "NOP",
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ return rc;
+}
+
+