aboutsummaryrefslogtreecommitdiffstats
path: root/sm/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-01-29 15:32:03 +0000
committerWerner Koch <[email protected]>2025-01-29 15:32:03 +0000
commit89055f24f4d3d645e1ac79b64421849e08a1c2a2 (patch)
tree426c1e802fd5392b5687ac4118db966d0b28b80d /sm/call-agent.c
parentagent: Fix ssh-agent's request_identities for skipped keys. (diff)
downloadgnupg-89055f24f4d3d645e1ac79b64421849e08a1c2a2.tar.gz
gnupg-89055f24f4d3d645e1ac79b64421849e08a1c2a2.zip
gpgsm: Allow CSR generation with an unprotected key.
* sm/call-agent.c (gpgsm_agent_genkey): Add arg no_protection. * sm/certreqgen.c (struct reqgen_ctrl_s): Add field no_protection. (read_parameters): Add keyword "%no-protection". (proc_parameters): Pass no_protection to gpgsm_agent_genkey.
Diffstat (limited to 'sm/call-agent.c')
-rw-r--r--sm/call-agent.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c
index 542c8495c..abce0387d 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -680,8 +680,8 @@ inq_genkey_parms (void *opaque, const char *line)
/* Call the agent to generate a new key */
-int
-gpgsm_agent_genkey (ctrl_t ctrl,
+gpg_error_t
+gpgsm_agent_genkey (ctrl_t ctrl, int no_protection,
ksba_const_sexp_t keyparms, ksba_sexp_t *r_pubkey)
{
int rc;
@@ -709,7 +709,9 @@ gpgsm_agent_genkey (ctrl_t ctrl,
if (!gk_parm.sexplen)
return gpg_error (GPG_ERR_INV_VALUE);
gnupg_get_isotime (timebuf);
- snprintf (line, sizeof line, "GENKEY --timestamp=%s", timebuf);
+ snprintf (line, sizeof line, "GENKEY%s --timestamp=%s",
+ no_protection? " --no-protection":"",
+ timebuf);
rc = assuan_transact (agent_ctx, line,
put_membuf_cb, &data,
inq_genkey_parms, &gk_parm, NULL, NULL);