summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-08-28 06:53:24 +0000
committertb <>2024-08-28 06:53:24 +0000
commita03c40153c8f8e484e8b98ea5a52b87116f9bf5a (patch)
treef2b5f4d07188920bdb84ffe433687f8697e4ed4d
parent079cd1e5ed7a1c794d168379bc23f4af38bf91d1 (diff)
downloadopenbsd-a03c40153c8f8e484e8b98ea5a52b87116f9bf5a.tar.gz
openbsd-a03c40153c8f8e484e8b98ea5a52b87116f9bf5a.tar.bz2
openbsd-a03c40153c8f8e484e8b98ea5a52b87116f9bf5a.zip
Fix underlying pkey of RSA-PSS
There are currently very few differences between the rsa_asn1_meth for plain RSA and the rsa_pss_asn1_meth for RSA-PSS apart from the obviously necessary differnces for base_method, pkey_id, pem_str and info (and the fact that RSA has support for legacy private key encoding). This had the lucky side effect that it didn't really matter which ameth one ended up using after OBJ_find_sigid_algs(). With the upcoming support for X509_get_signature_infO() for RSA-PSS, this needs to change as for RSA-PSS we need to decode the PSS parameters for extracting the "security level", whereas for RSA we can just use the hash length. Thus, for RSA-PSS switch pkey_id from the incorrect rsaEncryption to rassaPss. ok jsing PS: OBJ_find_sigid_algs() manual is no longer entirely correct, but this has been the case since we added Ed25519 support to obj_xref.
-rw-r--r--src/lib/libcrypto/objects/obj_xref.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/objects/obj_xref.c b/src/lib/libcrypto/objects/obj_xref.c
index 321c2f50b6..04611d68e3 100644
--- a/src/lib/libcrypto/objects/obj_xref.c
+++ b/src/lib/libcrypto/objects/obj_xref.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_xref.c,v 1.14 2024/01/27 16:08:43 tb Exp $ */ 1/* $OpenBSD: obj_xref.c,v 1.15 2024/08/28 06:53:24 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
@@ -178,7 +178,7 @@ static const struct {
178 { 178 {
179 .sign_nid = NID_rsassaPss, 179 .sign_nid = NID_rsassaPss,
180 .hash_nid = NID_undef, 180 .hash_nid = NID_undef,
181 .pkey_nid = NID_rsaEncryption, 181 .pkey_nid = NID_rsassaPss,
182 }, 182 },
183 { 183 {
184 .sign_nid = NID_id_tc26_signwithdigest_gost3410_2012_256, 184 .sign_nid = NID_id_tc26_signwithdigest_gost3410_2012_256,