Bug 2186819

Summary: OpenSSL rsa_verify_recover doesn't use the same key checks as rsa_verify in FIPS mode
Product: Red Hat Enterprise Linux 9 Reporter: Alicja Kario <hkario>
Component: opensslAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED ERRATA QA Contact: Alicja Kario <hkario>
Severity: medium Docs Contact:
Priority: high    
Version: 9.0CC: cllang, ssorce
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssl-3.0.7-16.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2188052 (view as bug list) Environment:
Last Closed: 2023-11-07 08:53:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2170421    
Bug Blocks: 2188052    

Description Alicja Kario 2023-04-14 15:15:22 UTC
Description of problem:
When operations like `openssl rsautl -verify -raw` are performed in FIPS mode, operations with 2000 bit keys are allowed, while with regular verification, for key sizes between 1024 and 2048 only multiples of 256 are allowed.

Version-Release number of selected component (if applicable):
openssl-3.0.1-46.el9_0.3.x86_64

How reproducible:
always

Steps to Reproduce:
1. On non-fips system create a key of atypical size and a file with binary length equal to the modulus
2. create the signature: openssl rsautl -sign -raw -inkey rsa/2000/key -in message.bin -out sig
3. in fips mode: openssl rsautl -verify -raw -inkey rsa/2000/pub -pubin -in sig -out sig.dec

Actual results:
Command succeeds

Expected results:
Command should fail with
409C00105F7F0000:error:1C800069:Provider routines:ossl_rsa_check_key:invalid key length:providers/common/securitycheck.c:67:operation: 64

Additional info:

Comment 11 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