summaryrefslogtreecommitdiffstats
path: root/providers/implementations
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-07-13 15:28:24 +0200
committerTomas Mraz <tomas@openssl.org>2021-07-16 11:29:26 +0200
commit07d189cee45e334cde119b547449841a4414e740 (patch)
tree31eedb1ad6b521dcd34ef35e62b358a24f828c19 /providers/implementations
parentca638147c8cdb7c49621f3f0acc628c090989b6a (diff)
Allow RSA signature operations with RSA_NO_PADDING
When no md is set, the raw operations should be allowed. Fixes #16056 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16068)
Diffstat (limited to 'providers/implementations')
-rw-r--r--providers/implementations/signature/rsa_sig.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c
index 40a97c0165..298d789b74 100644
--- a/providers/implementations/signature/rsa_sig.c
+++ b/providers/implementations/signature/rsa_sig.c
@@ -126,8 +126,11 @@ static int rsa_check_padding(const PROV_RSA_CTX *prsactx,
{
switch(prsactx->pad_mode) {
case RSA_NO_PADDING:
- ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);
- return 0;
+ if (mdname != NULL || mdnid != NID_undef) {
+ ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);
+ return 0;
+ }
+ break;
case RSA_X931_PADDING:
if (RSA_X931_hash_id(mdnid) == -1) {
ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_X931_DIGEST);