The padding check was not complete and would miss the Message
Signature API case, which also needs to be rejected.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28741)
#ifdef FIPS_MODULE
static int rsa_x931_padding_allowed(PROV_RSA_CTX *ctx)
{
- int approved = ((ctx->operation & EVP_PKEY_OP_SIGN) == 0);
-
- if (!approved) {
+ if ((ctx->operation
+ & (EVP_PKEY_OP_SIGNMSG | EVP_PKEY_OP_SIGN)) != 0) {
if (!OSSL_FIPS_IND_ON_UNAPPROVED(ctx, OSSL_FIPS_IND_SETTABLE2,
ctx->libctx,
"RSA Sign set ctx", "X931 Padding",
Input = "Hello World"
Result = DIGESTSIGNINIT_ERROR
+# RSA Signing with X931 is not approved in FIPS 140-3
+Availablein = fips
+FIPSversion = >=4.0.0
+DigestSign = SHA256
+Key = RSA-2048
+Ctrl = rsa_padding_mode:x931
+Input = "Hello World"
+Result = PKEY_CTRL_ERROR
+Reason = illegal or unsupported padding mode