Teach OBJ_find_sigid_{,by_}algs(3) about ECDSA with SHA-3
authortb <tb@openbsd.org>
Sat, 27 Jan 2024 16:08:43 +0000 (16:08 +0000)
committertb <tb@openbsd.org>
Sat, 27 Jan 2024 16:08:43 +0000 (16:08 +0000)
This allows signing and verifying ASN.1 "items" using the ECDSA with SHA-3
signature algorithms. With this diff, ECDSA certificates and CMS products
using ECDSA with SHA-3 can be generated using the openssl command line tool.

ok jsing

lib/libcrypto/objects/obj_xref.c

index 0fca228..321c2f5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: obj_xref.c,v 1.13 2023/07/28 10:25:05 tb Exp $ */
+/*     $OpenBSD: obj_xref.c,v 1.14 2024/01/27 16:08:43 tb Exp $ */
 
 /*
  * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
@@ -265,6 +265,26 @@ static const struct {
                .hash_nid = NID_sha3_512,
                .pkey_nid = NID_rsaEncryption,
        },
+       {
+               .sign_nid = NID_ecdsa_with_SHA3_224,
+               .hash_nid = NID_sha3_224,
+               .pkey_nid = NID_X9_62_id_ecPublicKey,
+       },
+       {
+               .sign_nid = NID_ecdsa_with_SHA3_256,
+               .hash_nid = NID_sha3_256,
+               .pkey_nid = NID_X9_62_id_ecPublicKey,
+       },
+       {
+               .sign_nid = NID_ecdsa_with_SHA3_384,
+               .hash_nid = NID_sha3_384,
+               .pkey_nid = NID_X9_62_id_ecPublicKey,
+       },
+       {
+               .sign_nid = NID_ecdsa_with_SHA3_512,
+               .hash_nid = NID_sha3_512,
+               .pkey_nid = NID_X9_62_id_ecPublicKey,
+       },
 };
 
 #define N_NID_TRIPLES (sizeof(nid_triple) / sizeof(nid_triple[0]))