Bug 2097837 - allow signature verification using RSA keys <2k in FIPS mode [rhel-8.7.0]
Summary: allow signature verification using RSA keys <2k in FIPS mode [rhel-8.7.0]
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nss
Version: 8.6
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: Bob Relyea
QA Contact: BaseOS QE Security Team
Mirek Jahoda
URL:
Whiteboard:
Depends On: 2091905
Blocks: 2098642
TreeView+ depends on / blocked
 
Reported: 2022-06-16 16:32 UTC by Bob Relyea
Modified: 2022-08-31 22:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
.NSS no longer support RSA keys shorter than 1023 bits The update of the Network Security Services (NSS) libraries changes the minimum key size for all RSA operations from 128 to 1023 bits. This means that NSS no longer perform the following functions: * Generate RSA keys shorter than 1023 bits. * Sign or verify RSA signatures with RSA keys shorter than 1023 bits. * Encrypt or decrypt values with RSA key shorter than 1023 bits.
Clone Of: 2091905
: 2098642 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-7588 0 None None None 2022-06-16 16:35:43 UTC
Red Hat Issue Tracker RHELPLAN-125509 0 None None None 2022-06-16 16:36:04 UTC

Description Bob Relyea 2022-06-16 16:32:49 UTC
+++ This bug was initially created as a clone of Bug #2091905 +++

We clarified with lab that we should be able to use the RSA keys for signature verification if they are of the following sizes:

  1024, 1280, 1536, 1792

Consider adapting NSS to also support these shorter key sizes. We may not want to enable these short key sizes by default in TLS, though.

--- Additional comment from Bob Relyea on 2022-06-16 09:30:13 PDT ---

ok, I'm coopting this bug. That's because there is code around this that was supposed to be upstream, but didn't make into the RHEL 3.79 NSS release. (https://phabricator.services.mozilla.com/D146341).

The base thing this bug describes is already done by NSS. NSS allows any signature for any rsa key between 128 and 16384 for both signing and verification in regular and FIPS mode. It only gives FIPS indicators for keys >2048.

The upstream patch was supposed to:
1) increase the low end of the RSA keys to 1024 in all cases (encryption/decryption/signing/verification).
2) give FIPS indicators for 1024, 1280, 1536, 1792, signing only.
3) allow crypto-policies to optionally add signing, and verification to the checks for minimum key sizes by set by policy.

this bug is now to include this patch as part of the rebase.

proposed AC: 
1) verify small RSA keys are no longer supported.
2) check the fips indicators for signing in FIPS mode.

These could be sanity checks by looking at RSA_MIN_MODULUS_BITS in lib/freebl/blapit.h (or /usr/include/nss3/blapit.h in an installed system), and looking at nss/lib/softokn/fips_algorithms.h to make sure that the verification entries in the table are there:

    { CKM_SHA224_RSA_PKCS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA256_RSA_PKCS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA384_RSA_PKCS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA512_RSA_PKCS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA224_RSA_PKCS_PSS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA256_RSA_PKCS_PSS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA384_RSA_PKCS_PSS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },
    { CKM_SHA512_RSA_PKCS_PSS, { RSA_LEGACY_FB_KEY, CKF_VERIFY }, RSA_LEGACY_FB_STEP, SFTKFIPSNone },


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