RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2168665 - In FIPS mode, openssl should not support RSA encryption or decryption without padding (outside of RSASVE) or provide an indicator
Summary: In FIPS mode, openssl should not support RSA encryption or decryption without...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssl
Version: 9.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Dmitry Belyavskiy
QA Contact: Hubert Kario
Jan Fiala
URL:
Whiteboard:
Depends On:
Blocks: 2170420 2170421 2178029
TreeView+ depends on / blocked
 
Reported: 2023-02-09 17:28 UTC by Clemens Lang
Modified: 2023-11-07 11:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Deprecated Functionality
Doc Text:
.OpenSSL requires padding for RSA encryption in FIPS mode OpenSSL no longer supports RSA encryption without padding in FIPS mode. RSA encryption without padding is uncommon and is rarely used. Note that key encapsulation with RSA (RSASVE) does not use padding but is still supported.
Clone Of:
: 2170420 2170421 2178029 (view as bug list)
Environment:
Last Closed: 2023-11-07 08:53:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-9559 0 None None None 2023-02-09 17:35:12 UTC
Red Hat Issue Tracker FIPS-30 0 None None None 2023-02-09 17:28:17 UTC
Red Hat Issue Tracker RHELPLAN-148207 0 None None None 2023-02-09 17:28:56 UTC
Red Hat Product Errata RHBA-2023:6627 0 None None None 2023-11-07 08:53:54 UTC

Description Clemens Lang 2023-02-09 17:28:17 UTC
Description of problem:
OpenSSL still supports RSA encryption and decryption without padding, which is not part of any of the FIPS standards except for the use-case as RSASVE (which is a separate function in both the provider and the libcrypto API).

Version-Release number of selected component (if applicable):
openssl-3.0.1-44.el9_0.1

How reproducible:
Run openssl/Regression/bz2053289-FIPS-provider-doesn-t-block-RSA-encryption-for-key across, check "RSA-2048 pad=none en/decryption: allowed in FIPS" – it should not succeed

Steps to Reproduce:
1. openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out rsa.pem
2. dd if=/dev/zero of=data bs=1 count=256 (Note /dev/zero; if you use /dev/urandom there's a chance this will fail because the data is larger than the modulus).
3. openssl pkeyutl -encrypt -pkeyopt rsa_padding_mode:none -inkey rsa.pem -in data -out /dev/null

Actual results:
Call succeeds, encryption is performed

Expected results:
Call fails if FIPS mode, or provides an indicator that supports querying whether this was an approved operation.

Additional info:
RSASVE uses a different entrypoint into the provider, but RSA-OAEP padding and RSASSA-PSS signatures seem to compute the padding in libcrypto and then call into the provider with a none padding mode, so this may lead to issues.

Comment 1 Clemens Lang 2023-02-10 15:16:25 UTC
Additionally, RSA signatures and signature verification should not support RSA_NO_PADDING. See https://gitlab.com/redhat/centos-stream/rpms/openssl/-/blob/c9s/0081-signature-Remove-X9.31-padding-from-FIPS-prov.patch which disabled this for X9.31 – we need a similar patch applied to the RSA_NO_PADDING case directly above it.

Comment 2 Dmitry Belyavskiy 2023-02-15 12:05:47 UTC
We also should check whether OAEP and PSS are inside the FIPS boundary

Comment 3 Dmitry Belyavskiy 2023-02-15 13:11:30 UTC
Looks like RSA_NO_PADDING is already forbidden for signature/verification according to the code. I will add the rejection to encryption.

Comment 22 errata-xmlrpc 2023-11-07 08:53:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (openssl bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6627


Note You need to log in before you can comment on or make changes to this bug.