1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

experiment: Fix keygrip and signature for 448.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-10-21 15:58:34 +09:00
parent 7965049441
commit cfe3752bd1
2 changed files with 6 additions and 5 deletions

View File

@ -1063,11 +1063,12 @@ keygrip_from_pk (PKT_public_key *pk, unsigned char *array)
case PUBKEY_ALGO_ECDSA:
case PUBKEY_ALGO_ECDH:
{
char *curve = openpgp_oid_to_str (pk->pkey[0]);
if (!curve)
char *curve_oid = openpgp_oid_to_str (pk->pkey[0]);
if (!curve_oid)
err = gpg_error_from_syserror ();
else
{
const char *curve = openpgp_oid_to_curve (curve_oid, 1);
gcry_mpi_t pubkey = openpgp_ecc_parse_key (pk->pubkey_algo,
curve, pk->pkey[1]);
@ -1078,8 +1079,8 @@ keygrip_from_pk (PKT_public_key *pk, unsigned char *array)
&& openpgp_oid_is_cv25519 (pk->pkey[0]))?
"(public-key(ecc(curve%s)(flags djb-tweak)(q%m)))":
"(public-key(ecc(curve%s)(q%m)))",
curve, pubkey);
xfree (curve);
curve_oid, pubkey);
xfree (curve_oid);
gcry_mpi_release (pubkey);
}
}

View File

@ -441,7 +441,7 @@ sos_sig_448 (gcry_mpi_t r, gcry_mpi_t s)
memcpy (p+1, p_r, 57);
memcpy (p+1+57, p_s, 57);
a = gcry_mpi_set_opaque (NULL, p, 0);
a = gcry_mpi_set_opaque (NULL, p, 7+57*2*8);
gcry_mpi_set_flag (a, GCRYMPI_FLAG_USER2);
return a;
}