mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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.
This commit is contained in:
parent
2469dc5aae
commit
89055f24f4
4 changed files with 15 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue