1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-17 15:44:34 +02:00

gpgsm: Fix the previous commit.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-03-27 19:41:03 +09:00
parent 49ea53b755
commit e06a8e3e87

View File

@ -731,20 +731,20 @@ proc_parameters (ctrl_t ctrl, struct para_data_s *para,
"(6:genkey(3:rsa(5:nbits%d:%s)))", "(6:genkey(3:rsa(5:nbits%d:%s)))",
(int)strlen (numbuf), numbuf); (int)strlen (numbuf), numbuf);
} }
else if (algo == GCRY_PK_ECC || algo == GCRY_PK_EDDSA) else if (algo == GCRY_PK_ECC)
{ {
const char *curve = get_parameter_value (para, pKEYCURVE, 0); const char *curve = get_parameter_value (para, pKEYCURVE, 0);
const char *flags; const char *flags;
if (algo == GCRY_PK_EDDSA) if (!strcmp (curve, "Ed25519"))
flags = "(flags eddsa)"; flags = "(5:flags5:eddsa)";
else if (!strcmp (curve, "Curve25519")) else if (!strcmp (curve, "Curve25519"))
flags = "(flags djb-tweak)"; flags = "(5:flags9:djb-tweak)";
else else
flags = ""; flags = "";
snprintf ((char*)keyparms, DIM (keyparms), snprintf ((char*)keyparms, DIM (keyparms),
"(genkey(ecc(curve %zu:%s)%s))", "(6:genkey(3:ecc(5:curve%zu:%s)%s))",
strlen (curve), curve, flags); strlen (curve), curve, flags);
} }
else else