From: Richard Levitte Date: Mon, 20 Jul 2020 14:09:47 +0000 (+0200) Subject: EVP, PROV: Add misc missing bits for RSA-PSS X-Git-Tag: openssl-3.0.0-alpha6~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=456b3b97a489d4be42f4258cb65bf76dfd8bab00;p=thirdparty%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/12492) --- diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 65a767b4d03..a7fd687dd0b 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 3231c020c96..21a35d7d9a4 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 d0cea458d12..d2a54598280 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;