summaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-09-29 02:56:58 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2021-09-29 02:56:58 +0200
commit86cb04a23d2b0849cf684238d6d704aa45293214 (patch)
treef2a4ddb389e7b05db45c218c49ceaede8feee408 /g10/keygen.c
parentkbx: A 20 byte fingerprint is right filled in version 2 blob. (diff)
downloadgnupg2-86cb04a23d2b0849cf684238d6d704aa45293214.tar.xz
gnupg2-86cb04a23d2b0849cf684238d6d704aa45293214.zip
gpg: Ed448 and X448 are only for v5 (for subkey).
* g10/keygen.c (generate_subkeypair): Specify KEYGEN_FLAG_CREATE_V5_KEY for Ed448 or X448 key. -- Reported-by: William Holmes Fixes-commit: 36355394d865f5760075e62267d70f7a7d5dd671 GnuPG-bug-id: 5609 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to '')
-rw-r--r--g10/keygen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 239e7aca1..cb6487ea3 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -5879,7 +5879,12 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock, const char *algostr,
else if (algo == PUBKEY_ALGO_ECDSA
|| algo == PUBKEY_ALGO_EDDSA
|| algo == PUBKEY_ALGO_ECDH)
- curve = ask_curve (&algo, NULL, NULL);
+ {
+ curve = ask_curve (&algo, NULL, NULL);
+
+ if (curve && (!strcmp (curve, "X448") || !strcmp (curve, "Ed448")))
+ keygen_flags |= KEYGEN_FLAG_CREATE_V5_KEY;
+ }
else
nbits = ask_keysize (algo, 0);