summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-07-20 16:09:47 +0200
committerRichard Levitte <levitte@openssl.org>2020-07-27 12:15:29 +0200
commit456b3b97a489d4be42f4258cb65bf76dfd8bab00 (patch)
tree378dea24d9c3249170ad419d63d95f4633369b98
parent51d9ac870acda2c818ce19c1174ed85f9a2f6eb7 (diff)
EVP, PROV: Add misc missing bits for RSA-PSS
- EVP_PKEY_is_a() didn't recognise "RSA-PSS" for legacy keys. - The RSA-PSS keymgmt didn't have a OSSL_FUNC_keymgmt_match() function. - ossl_prov_prepare_rsa_params() didn't return 1 for unrestricted RSA-PSS params. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12492)
-rw-r--r--crypto/evp/p_lib.c2
-rw-r--r--providers/implementations/keymgmt/rsa_kmgmt.c1
-rw-r--r--providers/implementations/serializers/serializer_rsa.c1
3 files changed, 4 insertions, 0 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 65a767b4d0..a7fd687dd0 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -935,6 +935,8 @@ int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name)
if (strcasecmp(name, "RSA") == 0)
type = EVP_PKEY_RSA;
+ else if (strcasecmp(name, "RSA-PSS") == 0)
+ type = EVP_PKEY_RSA_PSS;
#ifndef OPENSSL_NO_EC
else if (strcasecmp(name, "EC") == 0)
type = EVP_PKEY_EC;
diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c
index 3231c020c9..21a35d7d9a 100644
--- a/providers/implementations/keymgmt/rsa_kmgmt.c
+++ b/providers/implementations/keymgmt/rsa_kmgmt.c
@@ -632,6 +632,7 @@ const OSSL_DISPATCH rsapss_keymgmt_functions[] = {
{ OSSL_FUNC_KEYMGMT_GET_PARAMS, (void (*) (void))rsa_get_params },
{ OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS, (void (*) (void))rsa_gettable_params },
{ OSSL_FUNC_KEYMGMT_HAS, (void (*)(void))rsa_has },
+ { OSSL_FUNC_KEYMGMT_MATCH, (void (*)(void))rsa_match },
{ OSSL_FUNC_KEYMGMT_VALIDATE, (void (*)(void))rsa_validate },
{ OSSL_FUNC_KEYMGMT_IMPORT, (void (*)(void))rsa_import },
{ OSSL_FUNC_KEYMGMT_IMPORT_TYPES, (void (*)(void))rsa_import_types },
diff --git a/providers/implementations/serializers/serializer_rsa.c b/providers/implementations/serializers/serializer_rsa.c
index d0cea458d1..d2a5459828 100644
--- a/providers/implementations/serializers/serializer_rsa.c
+++ b/providers/implementations/serializers/serializer_rsa.c
@@ -199,6 +199,7 @@ int ossl_prov_prepare_rsa_params(const void *rsa, int nid,
case RSA_FLAG_TYPE_RSASSAPSS:
if (rsa_pss_params_30_is_unrestricted(pss)) {
*pstrtype = V_ASN1_UNDEF;
+ return 1;
} else {
ASN1_STRING *astr = NULL;
WPACKET pkt;