mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-26 22:29:58 +01:00
gpg: Don't use EdDSA algo ID for ECDSA curves.
* g10/keygen.c (ask_curve): Change algo ID to ECDSA if it changed from an EdDSA curve. -- (cherry picked from commit 4324560b2c0bb76a1769535c383424a042e505ae) This change matters when it is called from ask_card_keyattr. Some-comments-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
644cabc6b3
commit
2f455d18ab
25
g10/keygen.c
25
g10/keygen.c
@ -2356,14 +2356,25 @@ ask_curve (int *algo, int *subkey_algo, const char *current)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the user selected a signing algorithm and Curve25519
|
/* If the user selected a signing algorithm and Curve25519
|
||||||
we need to set the algo to EdDSA and update the curve name. */
|
we need to set the algo to EdDSA and update the curve name.
|
||||||
if ((*algo == PUBKEY_ALGO_ECDSA || *algo == PUBKEY_ALGO_EDDSA)
|
If switching away from EdDSA, we need to set the algo back
|
||||||
&& curves[idx].eddsa_curve)
|
to ECDSA. */
|
||||||
|
if (*algo == PUBKEY_ALGO_ECDSA || *algo == PUBKEY_ALGO_EDDSA)
|
||||||
{
|
{
|
||||||
if (subkey_algo && *subkey_algo == PUBKEY_ALGO_ECDSA)
|
if (curves[idx].eddsa_curve)
|
||||||
*subkey_algo = PUBKEY_ALGO_EDDSA;
|
{
|
||||||
*algo = PUBKEY_ALGO_EDDSA;
|
if (subkey_algo && *subkey_algo == PUBKEY_ALGO_ECDSA)
|
||||||
result = curves[idx].eddsa_curve;
|
*subkey_algo = PUBKEY_ALGO_EDDSA;
|
||||||
|
*algo = PUBKEY_ALGO_EDDSA;
|
||||||
|
result = curves[idx].eddsa_curve;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (subkey_algo && *subkey_algo == PUBKEY_ALGO_EDDSA)
|
||||||
|
*subkey_algo = PUBKEY_ALGO_ECDSA;
|
||||||
|
*algo = PUBKEY_ALGO_ECDSA;
|
||||||
|
result = curves[idx].name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = curves[idx].name;
|
result = curves[idx].name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user