From fa5808c10d4148106c5352199c21acab20f0490c Mon Sep 17 00:00:00 2001
From: tb <>
Date: Sat, 27 Jan 2024 16:08:43 +0000
Subject: Teach OBJ_find_sigid_{,by_}algs(3) about ECDSA with SHA-3

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
---
 src/lib/libcrypto/objects/obj_xref.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

(limited to 'src/lib')

diff --git a/src/lib/libcrypto/objects/obj_xref.c b/src/lib/libcrypto/objects/obj_xref.c
index 0fca228ed8..321c2f50b6 100644
--- a/src/lib/libcrypto/objects/obj_xref.c
+++ b/src/lib/libcrypto/objects/obj_xref.c
@@ -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]))
-- 
cgit v1.2.3-55-g6feb