summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-01-26 11:39:27 +0100
committerTomas Mraz <tomas@openssl.org>2021-01-29 10:47:02 +0100
commita2a5506b9329b978a2a5b11a518b9789446ad310 (patch)
treea4c65e7a10d06f57e1296969d3c6d50fb6de8b2f /providers
parente947a0642db111bb34547b5f7d48e13163492ca5 (diff)
rsa_kmgmt: Return OSSL_PKEY_PARAM_DEFAULT_DIGEST for unrestricted PSS keys
Add a testcase to the test_req covering the issue. Fixes #13957 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13967)
Diffstat (limited to 'providers')
-rw-r--r--providers/implementations/keymgmt/rsa_kmgmt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c
index 9648c5f65d..9f783c56d8 100644
--- a/providers/implementations/keymgmt/rsa_kmgmt.c
+++ b/providers/implementations/keymgmt/rsa_kmgmt.c
@@ -312,18 +312,19 @@ static int rsa_get_params(void *key, OSSL_PARAM params[])
return 0;
/*
- * For RSA-PSS keys, we ignore the default digest request
- * TODO(3.0) with RSA-OAEP keys, this may need to be amended
+ * For restricted RSA-PSS keys, we ignore the default digest request.
+ * With RSA-OAEP keys, this may need to be amended.
*/
if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
- && rsa_type != RSA_FLAG_TYPE_RSASSAPSS) {
+ && (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
+ || ossl_rsa_pss_params_30_is_unrestricted(pss_params))) {
if (!OSSL_PARAM_set_utf8_string(p, RSA_DEFAULT_MD))
return 0;
}
/*
- * For non-RSA-PSS keys, we ignore the mandatory digest request
- * TODO(3.0) with RSA-OAEP keys, this may need to be amended
+ * For non-RSA-PSS keys, we ignore the mandatory digest request.
+ * With RSA-OAEP keys, this may need to be amended.
*/
if ((p = OSSL_PARAM_locate(params,
OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL