Skip to content

openssl error digest not allowed on RSA PSS signature in fips mode #114260

@rcatolino

Description

@rcatolino

Description

If openssl is built/configured in fips mode, when trying to do a signature with an RSA key using the PSS padding format, openssl returns the error 1C8000AE:Provider routines::digest not allowed

Reproduction Steps

Expected behavior

We get a valid signature and no error.

Actual behavior

We get the error 1C8000AE:Provider routines::digest not allowed from openssl.

Regression?

No response

Known Workarounds

No response

Configuration

  • linux x86_64
  • .NET 9.0.202
  • openssl 3.0.9 built in fips mode
    Using the following openssl configuration:
openssl_conf = default_conf

[default_conf]
providers = provider_sect

[provider_sect]
fips = fips_sect
base = base_sect

[fips_sect]
activate = 1
conditional-errors = 1
security-checks = 1

[base_sect]
activate = 1

Other information

This issue stems from the ConfigureSignature function in the CryptoNative wrapper which calls EVP_PKEY_CTX_set_rsa_padding before setting the digest used for mgf1.

In this situation openssl defaults to SHA1, see here. In fips mode SHA1 is forbidden and the set_rsa_padding call fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions