mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
gpg: Fix batch generation of ECC keys.
* g10/keygen.c (get_parameter_algo): Map ECC algorithm strings directly. -- Interactive generation of the keys uses the OpenPGP algorithms numbers but batch generation allows the use of strings. Reported-by: Gaetan Bisson. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0082766aac
commit
b716e6a699
@ -2826,6 +2826,8 @@ get_parameter_algo( struct para_data_s *para, enum para_name key,
|
|||||||
if (!r)
|
if (!r)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* Note that we need to handle the ECC algorithms specified as
|
||||||
|
strings directly because Libgcrypt folds them all to ECC. */
|
||||||
if (!ascii_strcasecmp (r->u.value, "default"))
|
if (!ascii_strcasecmp (r->u.value, "default"))
|
||||||
{
|
{
|
||||||
/* Note: If you change this default algo, remember to change it
|
/* Note: If you change this default algo, remember to change it
|
||||||
@ -2839,6 +2841,12 @@ get_parameter_algo( struct para_data_s *para, enum para_name key,
|
|||||||
else if (!strcmp (r->u.value, "ELG-E")
|
else if (!strcmp (r->u.value, "ELG-E")
|
||||||
|| !strcmp (r->u.value, "ELG"))
|
|| !strcmp (r->u.value, "ELG"))
|
||||||
i = PUBKEY_ALGO_ELGAMAL_E;
|
i = PUBKEY_ALGO_ELGAMAL_E;
|
||||||
|
else if (!ascii_strcasecmp (r->u.value, "EdDSA"))
|
||||||
|
i = PUBKEY_ALGO_EDDSA;
|
||||||
|
else if (!ascii_strcasecmp (r->u.value, "ECDSA"))
|
||||||
|
i = PUBKEY_ALGO_ECDSA;
|
||||||
|
else if (!ascii_strcasecmp (r->u.value, "ECDH"))
|
||||||
|
i = PUBKEY_ALGO_ECDH;
|
||||||
else
|
else
|
||||||
i = map_pk_gcry_to_openpgp (gcry_pk_map_name (r->u.value));
|
i = map_pk_gcry_to_openpgp (gcry_pk_map_name (r->u.value));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user