diff options
author | NIIBE Yutaka <[email protected]> | 2020-06-05 00:20:21 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-06-05 00:20:21 +0000 |
commit | a7d46c78e242e72f6ff681f6fe56ffc4dcb74a18 (patch) | |
tree | f1ec4258dfdb3e166876e1671829c6baadcf7854 /agent/command-ssh.c | |
parent | agent: Remove duplicated code for EdDSA. (diff) | |
download | gnupg-a7d46c78e242e72f6ff681f6fe56ffc4dcb74a18.tar.gz gnupg-a7d46c78e242e72f6ff681f6fe56ffc4dcb74a18.zip |
agent,ssh: Tighten condition for EdDSA.
* agent/command-ssh.c (ssh_key_to_blob): Prepare for non-prefixed
point representation of EdDSA.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r-- | agent/command-ssh.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c index fc52de2f1..2f8712b5c 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -1955,14 +1955,13 @@ ssh_key_to_blob (gcry_sexp_t sexp, int with_secret, } if ((key_spec.flags & SPEC_FLAG_IS_EdDSA)) { - data = gcry_sexp_nth_data (value_pair, 1, &datalen); if (!data) { err = gpg_error (GPG_ERR_INV_SEXP); goto out; } - if (*p_elems == 'q' && datalen) + if (*p_elems == 'q' && (datalen & 1) && *data == 0x40) { /* Remove the prefix 0x40. */ data++; datalen--; |