diff --git a/g10/keyid.c b/g10/keyid.c index 8264fe9d6..e365b84f0 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -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); } } diff --git a/g10/sign.c b/g10/sign.c index c7bfff89c..4a0004381 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -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; }