aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-05-18 17:24:41 +0000
committerWerner Koch <[email protected]>2020-05-18 17:24:41 +0000
commitb18fb0264abdb6cb0a99ba0ba941dc9a6e35f74a (patch)
tree28758d568244d5c5dd0c0adabd0022e55d370d5b /agent/command-ssh.c
parentsm: Support import and verification of EdDSA certificates. (diff)
downloadgnupg-b18fb0264abdb6cb0a99ba0ba941dc9a6e35f74a.tar.gz
gnupg-b18fb0264abdb6cb0a99ba0ba941dc9a6e35f74a.zip
agent: Allow to use SETHASH for arbitrary data.
* agent/agent.h (struct server_control_s): Add field digest.data. * agent/gpg-agent.c (agent_deinit_default_ctrl): Free that field. * agent/command.c (reset_notify): Ditto. (start_command_handler): ditto. (cmd_sethash): Add new option --inquire. * agent/call-scd.c (agent_card_pksign): For now return an error if inquire mode was used. * agent/command-ssh.c (ssh_handler_sign_request): Make sure digest.data is cleared. * agent/divert-scd.c (divert_pksign): Implement inquire mode. * agent/pksign.c (agent_pksign_do): Ditto. -- This is required to support EdDSA according to RFC8410. GnuPG-bug-id: 4888
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r--agent/command-ssh.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 51f37e18b..881f9372a 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -2809,6 +2809,8 @@ ssh_handler_sign_request (ctrl_t ctrl, estream_t request, estream_t response)
if (!hash_algo)
hash_algo = GCRY_MD_SHA1; /* Use the default. */
ctrl->digest.algo = hash_algo;
+ xfree (ctrl->digest.data);
+ ctrl->digest.data = NULL;
if ((spec.flags & SPEC_FLAG_USE_PKCS1V2))
ctrl->digest.raw_value = 0;
else