mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
gpg: Ed448 and X448 are only for v5 for --full-gen-key.
* g10/keygen.c (generate_keypair): Set pVERSION = 5, pSUBVERSION = 5, when it's Ed448 or X448. -- Fixes-commit: 36355394d865f5760075e62267d70f7a7d5dd671 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
be81941e1a
commit
2b50f94267
25
g10/keygen.c
25
g10/keygen.c
@ -4955,6 +4955,14 @@ generate_keypair (ctrl_t ctrl, int full, const char *fname,
|
||||
strcpy (r->u.value, curve);
|
||||
r->next = para;
|
||||
para = r;
|
||||
if (!strcmp (curve, "Ed448"))
|
||||
{
|
||||
r = xmalloc_clear (sizeof *r + 20);
|
||||
r->key = pVERSION;
|
||||
snprintf (r->u.value, 20, "%d", 5);
|
||||
r->next = para;
|
||||
para = r;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4999,7 +5007,14 @@ generate_keypair (ctrl_t ctrl, int full, const char *fname,
|
||||
if (!strcmp (curve, "Ed25519"))
|
||||
curve = "Curve25519";
|
||||
else
|
||||
curve = "X448";
|
||||
{
|
||||
curve = "X448";
|
||||
r = xmalloc_clear (sizeof *r + 20);
|
||||
r->key = pSUBVERSION;
|
||||
snprintf (r->u.value, 20, "%d", 5);
|
||||
r->next = para;
|
||||
para = r;
|
||||
}
|
||||
}
|
||||
r = xmalloc_clear (sizeof *r + strlen (curve));
|
||||
r->key = pSUBKEYCURVE;
|
||||
@ -5022,6 +5037,14 @@ generate_keypair (ctrl_t ctrl, int full, const char *fname,
|
||||
strcpy (r->u.value, curve);
|
||||
r->next = para;
|
||||
para = r;
|
||||
if (!strcmp (curve, "Ed448"))
|
||||
{
|
||||
r = xmalloc_clear (sizeof *r + 20);
|
||||
r->key = pVERSION;
|
||||
snprintf (r->u.value, 20, "%d", 5);
|
||||
r->next = para;
|
||||
para = r;
|
||||
}
|
||||
}
|
||||
|
||||
r = xmalloc_clear( sizeof *r + 20 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user