From 0dadb9f531e1842356c4ae404e5ba62d4aa3bb35 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 27 Jan 2024 16:08:43 +0000 Subject: [PATCH] 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 --- lib/libcrypto/objects/obj_xref.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/libcrypto/objects/obj_xref.c b/lib/libcrypto/objects/obj_xref.c index 0fca228ed84..321c2f50b6b 100644 --- a/lib/libcrypto/objects/obj_xref.c +++ b/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 @@ -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])) -- 2.20.1