Bug 2182350

Summary: kcapi tests fail in FIPS mode
Product: Red Hat Enterprise Linux 9 Reporter: Ondrej Moriš <omoris>
Component: libkcapiAssignee: Zoltan Fridrich <zfridric>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 9.2CC: omosnace, qe-baseos-security, ssorce, zfridric
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2180552 Environment:
Last Closed: 2023-09-06 14:58:42 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: 2180552    
Bug Blocks:    
Attachments:
Description Flags
Output of /CoreOS/libkcapi/Sanity/upstream-tests none

Description Ondrej Moriš 2023-03-28 10:40:20 UTC
Created attachment 1954123 [details]
Output of /CoreOS/libkcapi/Sanity/upstream-tests

Description of problem:

Recent changes in RHEL-9 kerne break the tests in FIPS mode. Since 5.14.0-78.el9 HMAC keys require at least 112 bits and various tests are using 64 bit keys (password / 70617373776f726464 in hex). The following tests fail:

 * /usr/libexec/libkcapi/test.sh
 * /usr/libexec/libkcapi/kcapi-enc-test.sh
 * /usr/libexec/libkcapi/kcapi-dgst-test.sh
 * /usr/libexec/libkcapi/hasher-test.sh
 * /usr/libexec/libkcapi/kcapi-convenience.sh

It is not a bug, the kernel is now more restrictive about key sizes in FIPS mode because FIPS 140-3 requires it. Tests can be modified to use longer keys.

Version-Release number of selected component (if applicable):

libkcapi-1.3.1-3.el9
5.14.0-283.el9

How reproducible:

100% in FIPS mode

Steps to Reproduce:

1. Enable FIPS mode
   # fips-mode-setup --enable && reboot

2. Disable 3DES cases for test.sh
   # sed -i 's/HASHEXEC="1 2/HASHEXEC="2/g' /usr/libexec/libkcapi/test.sh 
   # sed -i 's/SYMEXEC="1 2 3 4 5 6 7/SYMEXEC="1 2 3/g' /usr/libexec/libkcapi/test.sh

3. Run the tests
   # /usr/libexec/libkcapi/test.sh
   # /usr/libexec/libkcapi/kcapi-enc-test.sh
   # /usr/libexec/libkcapi/kcapi-dgst-test.sh
   # /usr/libexec/libkcapi/hasher-test.sh
   # /usr/libexec/libkcapi/kcapi-convenience.sh

Actual results:

All tests failed (see attached taskout.log).

Expected results:

All Test passed.

Additional info:

+++ This bug was initially created as a clone of Bug #2180552 +++

Comment 1 RHEL Program Management 2023-09-06 14:53:42 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 2 RHEL Program Management 2023-09-06 14:58:42 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.