diff options
author | Werner Koch <[email protected]> | 2020-05-18 17:24:41 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-05-18 17:24:41 +0000 |
commit | b18fb0264abdb6cb0a99ba0ba941dc9a6e35f74a (patch) | |
tree | 28758d568244d5c5dd0c0adabd0022e55d370d5b /agent/divert-scd.c | |
parent | sm: Support import and verification of EdDSA certificates. (diff) | |
download | gnupg-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/divert-scd.c')
-rw-r--r-- | agent/divert-scd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c index d8076d158..7587d4478 100644 --- a/agent/divert-scd.c +++ b/agent/divert-scd.c @@ -437,7 +437,14 @@ divert_pksign (ctrl_t ctrl, const char *desc_text, const unsigned char *grip, /* Note that the KID may be an keyref or a keygrip. The signing * functions handle both. */ - if (algo == MD_USER_TLS_MD5SHA1) + if (!algo) + { + /* This is the PureEdDSA case. (DIGEST,DIGESTLEN) this the + * entire data which will be signed. */ + rc = agent_card_pksign (ctrl, kid, getpin_cb, ctrl, NULL, + 0, digest, digestlen, &sigval, &siglen); + } + else if (algo == MD_USER_TLS_MD5SHA1) { int save = ctrl->use_auth_call; ctrl->use_auth_call = 1; |