Skip to content

Commit

Permalink
pkcs11-tool.c - Update EC type curves
Browse files Browse the repository at this point in the history
 On branch X25519-improvements-2
 Changes to be committed:
	modified:   tools/pkcs11-tool.c
  • Loading branch information
dengert committed Jan 6, 2024
1 parent 5801209 commit 1b0d7c9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/tools/pkcs11-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,23 @@ static struct ec_curve_info {
{"secp256k1", "1.3.132.0.10", "06052B8104000A", 256, 0},
{"secp521k1", "1.3.132.0.35", "06052B81040023", 521, 0},

{"edwards25519","1.3.6.1.4.11591.15.1", "130c656477617264733235353139", 255, CKM_EC_EDWARDS_KEY_PAIR_GEN},
{"curve25519", "1.3.6.1.4.3029.1.5.1", "130a63757276653235353139", 255, CKM_EC_MONTGOMERY_KEY_PAIR_GEN},
/* Some of the following may not yet be supported by the OpenSC module, but may be other modules */
/* OpenPGP extensions by Yubikey and GNUK are not defined in RFCs, so pass by printable string */
/* See PKCS#11 3.0 2.3.7 */
{"edwards25519", "1.3.6.1.4.11591.15.1", "130c656477617264733235353139", 255, CKM_EC_EDWARDS_KEY_PAIR_GEN}, /* send by curve name */
{"curve25519", "1.3.6.1.4.3029.1.5.1", "130a63757276653235353139", 255, CKM_EC_MONTGOMERY_KEY_PAIR_GEN}, /* send by curve name */

/* RFC8410, EDWARDS and MONTGOMERY curves are used by GnuPG and also by OpenSSL */

{"X25519", "1.3.101.110", "06032b656e", 255, CKM_EC_MONTGOMERY_KEY_PAIR_GEN}, /* RFC 4810 send by OID */
{"X448", "1.3.101.111", "06032b656f", 448, CKM_EC_MONTGOMERY_KEY_PAIR_GEN}, /* RFC 4810 send by OID */
{"Ed25519", "1.3.101.112", "06032b6570", 255, CKM_EC_EDWARDS_KEY_PAIR_GEN}, /* RFC 4810 send by OID */
{"Ed488", "1.3.101.113", "06032b6570", 488, CKM_EC_EDWARDS_KEY_PAIR_GEN}, /* RFC 4810 send by OID */

/* GnuPG openpgp curves as used in gnupg-card are equivelent to RFC8410 OIDs */
{"cv25519", "1.3.101.110", "06032b656e", 255, CKM_EC_MONTGOMERY_KEY_PAIR_GEN},
{"ed25519", "1.3.101.112", "06032b6570", 255, CKM_EC_EDWARDS_KEY_PAIR_GEN},
/* OpenSC card-openpgp.c will map these to what is need on the card */

{NULL, NULL, NULL, 0, 0},
};
Expand Down

0 comments on commit 1b0d7c9

Please sign in to comment.