Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1173595

Summary: Test set_pkcs12_cred broken in FIPS mode
Product: Red Hat Enterprise Linux 7 Reporter: Stanislav Zidek <szidek>
Component: gnutlsAssignee: Nikos Mavrogiannopoulos <nmavrogi>
Status: CLOSED ERRATA QA Contact: Stanislav Zidek <szidek>
Severity: low Docs Contact:
Priority: low    
Version: 7.1CC: nmavrogi, pvrabec, tmraz
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gnutls-3.3.22-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 00:58:26 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:    
Bug Blocks: 839624    

Description Stanislav Zidek 2014-12-12 13:31:28 UTC
Description of problem:
Internal test suite, which is executed during srpm rebuild, fails on systems in FIPS-140-2 mode.

Version-Release number of selected component (if applicable):
gnutls-3.3.8-11.el7

How reproducible:
always

Steps to Reproduce:
1. try to build package from source rpm on FIPS enabled system

Actual results:
...
FAIL: set_pkcs12_cred
...
============================================================================
Testsuite summary for GnuTLS 3.3.8
============================================================================
# TOTAL: 86
# PASS:  79
# SKIP:  6
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
...

From the test log:
# cat set_pkcs12_cred.log 
x509_pkcs12 failed -50: The request is invalid.

More verbose output:
# GNUTLS_DEBUG_LEVEL=99 ./set_pkcs12_cred
gnutls[2]: Enabled GnuTLS logging...
gnutls[2]: FIPS140-2 mode enabled
gnutls[2]: FIPS140-2 mode: 1
gnutls[2]: AES-128-CBC self check succeeded
gnutls[2]: Intel SSSE3 was detected
gnutls[2]: Intel AES accelerator was detected
gnutls[2]: Intel GCM accelerator was detected
gnutls[2]: 3DES-CBC self check succeeded
gnutls[2]: AES-256-GCM self check succeeded
gnutls[2]: MAC-SHA1 self check succeeded
gnutls[2]: MAC-SHA224 self check succeeded
gnutls[2]: MAC-SHA256 self check succeeded
gnutls[2]: MAC-SHA384 self check succeeded
gnutls[2]: MAC-SHA512 self check succeeded
gnutls[3]: ASSERT: pk.c:717
gnutls[3]: ASSERT: gnutls_pubkey.c:1959
gnutls[3]: ASSERT: gnutls_pubkey.c:1569
gnutls[2]: RSA-2048-known-sig self test succeeded
gnutls[3]: ASSERT: x509_b64.c:299
gnutls[9]: Could not find '-----BEGIN RSA PRIVATE KEY'
gnutls[3]: ASSERT: pk.c:685
gnutls[3]: ASSERT: gnutls_pubkey.c:1970
gnutls[3]: ASSERT: gnutls_pubkey.c:1569
gnutls[2]: DSA-2048-known-sig self test succeeded
gnutls[2]: ECDH self test succeeded
gnutls[2]: DH self test succeeded
gnutls[2]: DRBG-AES self test succeeded
gnutls[2]: Loading: /tmp/tmp.ZJ0dEADSqr/rpmroot/BUILD/gnutls-3.3.8/lib/.libs/libgnutls.so.28
gnutls[2]: Successfully verified library MAC for libgnutls.so.28
gnutls[2]: Loading: /lib64/libnettle.so.4
gnutls[2]: Successfully verified library MAC for libnettle.so.4
gnutls[2]: Loading: /lib64/libhogweed.so.2
gnutls[2]: Successfully verified library MAC for libhogweed.so.2
gnutls[2]: Loading: /lib64/libgmp.so.10
gnutls[2]: Could not open /lib64/.libgmp.so.10.hmac for MAC testing: Error while reading file.
gnutls[2]: Successfully verified library MAC for libgmp.so.10
<9>| salt.size: 8
<9>| iterationCount: 2048
<3>| ASSERT: cipher.c:270
<3>| ASSERT: gnutls_cipher_int.c:103
<3>| ASSERT: privkey_pkcs8.c:1723
<3>| ASSERT: privkey_pkcs8.c:2306
<3>| ASSERT: pkcs12_bag.c:680
<3>| ASSERT: pkcs12.c:1489
<3>| ASSERT: gnutls_x509.c:1832
x509_pkcs12 failed -50: The request is invalid.

Expected results:
test suite passes, package is built correctly

Additional info:
I did some debugging and found out that the problem is caused by old non-FIPS-compliant algorithms used in example files, e.g. PKCS12_RC2_40_SHA1 in client.p12.

Comment 3 Nikos Mavrogiannopoulos 2016-02-10 13:32:09 UTC
A fix is trivial and already upstream:
https://gitlab.com/gnutls/gnutls/commit/e9f6d9d4d3d7fd15c3028ceb8c00defd2fdd8121

Comment 8 errata-xmlrpc 2016-11-04 00:58:26 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, 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://rhn.redhat.com/errata/RHBA-2016-2218.html