mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg,agent: Support Ed448 signing.
* agent/pksign.c (do_encode_eddsa): First argument is NBITs, so that it can support Ed448, as well as Ed25519. (agent_pksign_do): Follow the change. * agent/sexp-secret.c (fixup_when_ecc_private_key): No fix-up needed for Ed448, it's only for classic curves. * common/openpgp-oid.c (oidtable): Add Ed448. * common/sexputil.c (get_pk_algo_from_key): Ed448 is only for EdDSA. * g10/export.c (match_curve_skey_pk): Ed448 is for EdDSA. * g10/keygen.c (gen_ecc): Support Ed448 with the name of "ed448". (ask_algo, parse_key_parameter_part): Handle "ed448". * g10/pkglue.c (pk_verify): Support Ed448. (pk_check_secret_key): Support Ed448. * g10/sign.c (hash_for): Defaults to SHA512 for Ed448. (make_keysig_packet): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
c94eea15d6
commit
a763bb2580
8 changed files with 147 additions and 98 deletions
|
@ -624,9 +624,10 @@ get_pk_algo_from_key (gcry_sexp_t key)
|
|||
algo = gcry_pk_map_name (algoname);
|
||||
if (algo == GCRY_PK_ECC)
|
||||
{
|
||||
gcry_sexp_t l1 = gcry_sexp_find_token (list, "flags", 0);
|
||||
gcry_sexp_t l1;
|
||||
int i;
|
||||
|
||||
l1 = gcry_sexp_find_token (list, "flags", 0);
|
||||
for (i = l1 ? gcry_sexp_length (l1)-1 : 0; i > 0; i--)
|
||||
{
|
||||
s = gcry_sexp_nth_data (l1, i, &n);
|
||||
|
@ -640,6 +641,12 @@ get_pk_algo_from_key (gcry_sexp_t key)
|
|||
}
|
||||
}
|
||||
gcry_sexp_release (l1);
|
||||
|
||||
l1 = gcry_sexp_find_token (list, "curve", 0);
|
||||
s = gcry_sexp_nth_data (l1, 1, &n);
|
||||
if (n == 5 && !memcmp (s, "Ed448", 5))
|
||||
algo = GCRY_PK_EDDSA;
|
||||
gcry_sexp_release (l1);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue