mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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 <gniibe@fsij.org>
This commit is contained in:
parent
2e988546c5
commit
a7d46c78e2
@ -1955,14 +1955,13 @@ ssh_key_to_blob (gcry_sexp_t sexp, int with_secret,
|
|||||||
}
|
}
|
||||||
if ((key_spec.flags & SPEC_FLAG_IS_EdDSA))
|
if ((key_spec.flags & SPEC_FLAG_IS_EdDSA))
|
||||||
{
|
{
|
||||||
|
|
||||||
data = gcry_sexp_nth_data (value_pair, 1, &datalen);
|
data = gcry_sexp_nth_data (value_pair, 1, &datalen);
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
err = gpg_error (GPG_ERR_INV_SEXP);
|
err = gpg_error (GPG_ERR_INV_SEXP);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (*p_elems == 'q' && datalen)
|
if (*p_elems == 'q' && (datalen & 1) && *data == 0x40)
|
||||||
{ /* Remove the prefix 0x40. */
|
{ /* Remove the prefix 0x40. */
|
||||||
data++;
|
data++;
|
||||||
datalen--;
|
datalen--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user