Skip to content

Commit

Permalink
pkcs15-init.c allow creation of eddsa and xeddsa keys
Browse files Browse the repository at this point in the history
Ad support for eddsa and xeddsa  key followed by  name or oid

 On branch X25519-improvements-2
 Changes to be committed:
	modified:   tools/pkcs15-init.c
  • Loading branch information
dengert committed Jan 14, 2024
1 parent bdde9c4 commit e31e306
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/pkcs15-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,8 @@ static const struct alg_spec alg_types_asym[] = {
{ "rsa", SC_ALGORITHM_RSA, 1024 },
{ "gost2001", SC_ALGORITHM_GOSTR3410, SC_PKCS15_GOSTR3410_KEYSIZE },
{ "ec", SC_ALGORITHM_EC, 0 },
{ "eddsa", SC_ALGORITHM_EDDSA, 0 },
{ "xeddsa", SC_ALGORITHM_XEDDSA, 0 },
{ NULL, -1, 0 }
};

Expand All @@ -751,7 +753,9 @@ parse_alg_spec(const struct alg_spec *types, const char *spec, unsigned int *key
spec++;

if (*spec) {
if (isalpha((unsigned char)*spec) && algorithm == SC_ALGORITHM_EC && prkey) {
if (isalpha((unsigned char)*spec)
&& (algorithm == SC_ALGORITHM_EC || algorithm == SC_ALGORITHM_EDDSA || SC_ALGORITHM_XEDDSA)
&& prkey) {
prkey->u.ec.params.named_curve = strdup(spec);
} else {
*keybits = strtoul(spec, &end, 10);
Expand Down

0 comments on commit e31e306

Please sign in to comment.