diff --git a/agent/agent.h b/agent/agent.h index e283398fe..1e3bf82b6 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -274,6 +274,10 @@ struct server_control_s unsigned char keygrip[20]; int have_keygrip; + /* Another keygrip for hybrid crypto. */ + unsigned char keygrip1[20]; + int have_keygrip1; + /* A flag to enable a hack to send the PKAUTH command instead of the PKSIGN command to the scdaemon. */ int use_auth_call; diff --git a/agent/command.c b/agent/command.c index 7bf161031..e2037dead 100644 --- a/agent/command.c +++ b/agent/command.c @@ -242,6 +242,7 @@ reset_notify (assuan_context_t ctx, char *line) memset (ctrl->keygrip, 0, 20); ctrl->have_keygrip = 0; + ctrl->have_keygrip1 = 0; ctrl->digest.valuelen = 0; xfree (ctrl->digest.data); ctrl->digest.data = NULL; @@ -763,8 +764,8 @@ cmd_havekey (assuan_context_t ctx, char *line) static const char hlp_sigkey[] = - "SIGKEY \n" - "SETKEY \n" + "SIGKEY [--another] \n" + "SETKEY [--another] \n" "\n" "Set the key used for a sign or decrypt operation."; static gpg_error_t @@ -772,11 +773,17 @@ cmd_sigkey (assuan_context_t ctx, char *line) { int rc; ctrl_t ctrl = assuan_get_pointer (ctx); + int opt_another; - rc = parse_keygrip (ctx, line, ctrl->keygrip); + opt_another = has_option (line, "--another"); + + rc = parse_keygrip (ctx, line, opt_another? ctrl->keygrip1 : ctrl->keygrip); if (rc) return rc; - ctrl->have_keygrip = 1; + if (opt_another) + ctrl->have_keygrip1 = 1; + else + ctrl->have_keygrip = 1; return 0; }