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 1751845

Summary: Crypto provider not installed: SunPKCS11 - in FIPS mode
Product: Red Hat Enterprise Linux 8 Reporter: Andrew John Hughes <ahughes>
Component: java-11-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: OpenJDK QA <java-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: dbhole, jvanek, mbalao, nhorman, wchadwic, zzambers
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-11-openjdk-11.0.4.11-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:46:29 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:
Attachments:
Description Flags
RH1751845 patch v0 none

Description Andrew John Hughes 2019-09-12 17:04:13 UTC
This bug was initially created as a copy of Bug #1750752

I am copying this bug because: 

FIPS changes are also in java-11-openjdk (bug 1725961) so similar fix is needed there as for java-1.8.0-openjdk.

Description of problem:

When FIPS mode is enabled and the following our OCSP provider [1] written in java is used, we got the following error (see below for complete traceback):

java.security.ProviderException: Crypto provider not installed: SunPKCS11

The problem happens only when FIPS crypto-policy is applied. We did not change anything in java.security, nss.cfg or nss.fips.cfg. They seem to be configured properly.

[1] http://download.eng.bos.redhat.com/qa/rhts/lookaside/ocspsrvd/ocspsrvd.jar

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

java-1.8.0-openjdk-1.8.0.222.b10-2.el8

How reproducible:

100% in FIPS mode

Steps to Reproduce:

0. Set FIPS crypto-policy.
1. Download ocspsrvd.jar from [1].
2. Generate CA key pair.
2. Execute 
java -jar ocspsrvd.jar -s SHA256withRSA -k certs/ca_key.key -c certs/ca_cert.pem -p 4242 -t GOOD 2>&1

Actual results:

java -jar ocspsrvd.jar -s SHA256withRSA -k certs/ca_key.key -c certs/ca_cert.pem -p 4242 -t GOOD 2>&1
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.security.ProviderException: Crypto provider not installed: SunPKCS11
	at sun.security.ssl.SunJSSE.<init>(SunJSSE.java:142)
	at sun.security.ssl.SunJSSE.<init>(SunJSSE.java:123)
	at com.sun.net.ssl.internal.ssl.Provider.<init>(Provider.java:51)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:224)
	at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
	at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
	at sun.security.jca.ProviderList.loadAll(ProviderList.java:282)
	at sun.security.jca.ProviderList.removeInvalid(ProviderList.java:299)
	at sun.security.jca.Providers.getFullProviderList(Providers.java:173)
	at java.security.Security.insertProviderAt(Security.java:375)
	at java.security.Security.addProvider(Security.java:418)
	at com.redhat.ocspsrvd.OCSPServd.main(OCSPServd.java:77)
	... 5 more

Expected results:

java -jar ocspsrvd.jar -s SHA256withRSA -k certs/ca_key.key -c certs/ca_cert.pem -p 4242 -t GOOD 2>&1
OCSPsrvd started on 0.0.0.0:4242

Additional info:

It is possible that this is just a configuration issue. If so, please let me know how to modify configuration and feel free to close the bug.

Comment 2 Martin Balao 2019-09-12 18:16:21 UTC
Created attachment 1614620 [details]
RH1751845 patch v0

Comment 3 Martin Balao 2019-09-12 18:18:49 UTC
I've attached "RH1751845 patch v0" to fix this issue in java-11-openjdk. We also need 8230923 [1] upstream patch.

--
[1] - http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-September/001868.html

Comment 19 errata-xmlrpc 2020-04-28 15:46:29 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://access.redhat.com/errata/RHBA-2020:1647