diff options
Diffstat (limited to 'sm/call-agent.c')
-rw-r--r-- | sm/call-agent.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c index d9c419ee2..a5b17e9c4 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -565,7 +565,7 @@ inq_genkey_parms (void *opaque, const char *line) -/* Call the agent to generate a newkey */ +/* Call the agent to generate a new key */ int gpgsm_agent_genkey (ctrl_t ctrl, ksba_const_sexp_t keyparms, ksba_sexp_t *r_pubkey) @@ -575,6 +575,8 @@ gpgsm_agent_genkey (ctrl_t ctrl, membuf_t data; size_t len; unsigned char *buf; + gnupg_isotime_t timebuf; + char line[ASSUAN_LINELENGTH]; *r_pubkey = NULL; rc = start_agent (ctrl); @@ -592,7 +594,9 @@ gpgsm_agent_genkey (ctrl_t ctrl, gk_parm.sexplen = gcry_sexp_canon_len (keyparms, 0, NULL, NULL); if (!gk_parm.sexplen) return gpg_error (GPG_ERR_INV_VALUE); - rc = assuan_transact (agent_ctx, "GENKEY", + gnupg_get_isotime (timebuf); + snprintf (line, sizeof line, "GENKEY --timestamp=%s", timebuf); + rc = assuan_transact (agent_ctx, line, put_membuf_cb, &data, inq_genkey_parms, &gk_parm, NULL, NULL); if (rc) @@ -1344,6 +1348,8 @@ gpgsm_agent_import_key (ctrl_t ctrl, const void *key, size_t keylen) { gpg_error_t err; struct import_key_parm_s parm; + gnupg_isotime_t timebuf; + char line[ASSUAN_LINELENGTH]; err = start_agent (ctrl); if (err) @@ -1354,7 +1360,9 @@ gpgsm_agent_import_key (ctrl_t ctrl, const void *key, size_t keylen) parm.key = key; parm.keylen = keylen; - err = assuan_transact (agent_ctx, "IMPORT_KEY", + gnupg_get_isotime (timebuf); + snprintf (line, sizeof line, "IMPORT_KEY --timestamp=%s", timebuf); + err = assuan_transact (agent_ctx, line, NULL, NULL, inq_import_key_parms, &parm, NULL, NULL); return err; } |