Bug 1913868

Summary: keytool is failing in FIPS mode, because OpenJDK doesn't depend on nss package
Product: Red Hat Enterprise Linux 8 Reporter: Andrew John Hughes <ahughes>
Component: java-1.8.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: OpenJDK QA <java-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: jvanek
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-1.8.0-openjdk-1.8.0.282.b08-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1914056 (view as bug list) Environment:
Last Closed: 2021-05-18 15:31:49 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: 1914056    

Description Andrew John Hughes 2021-01-07 18:31:05 UTC
This bug was initially created as a copy of Bug #1894083

I am copying this bug because: 

java-1.8.0-openjdk also lacking NSS dependency.

Description of problem:

As a part if RHV installation we are generating CA key and certificate using openssl, but we need to import CA certificate into java keystore. Everything works fine in standard RHEL installation, but there is an exception when RHEL is configure to use FIPS mode.

Here is the command output:

/usr/lib/jvm/jre-11-openjdk-11.0.9.11-2.el8_3.x86_64/bin/keytool -v -import -noprompt -trustcacerts -alias cacert -keypass mypass -file ca.pem -keystore .truststore -storepass mypass
keytool error: java.security.ProviderException: Could not initialize NSS
java.security.ProviderException: Could not initialize NSS
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:217)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:112)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:109)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:109)
        at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:251)
        at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:242)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:242)
        at java.base/sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:222)
        at java.base/sun.security.jca.ProviderList.getProvider(ProviderList.java:266)
        at java.base/sun.security.jca.ProviderList.getService(ProviderList.java:379)
        at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
        at java.base/java.security.Security.getImpl(Security.java:717)
        at java.base/java.security.KeyStore.getInstance(KeyStore.java:875)
        at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:925)
        at java.base/sun.security.tools.keytool.Main.run(Main.java:405)
        at java.base/sun.security.tools.keytool.Main.main(Main.java:398)
Caused by: java.io.FileNotFoundException: /usr/lib64/libnss3.so
        at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:193)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:212)
        ... 17 more


Shouldn't OpenJDK package depend on nss package to prevent that failure?

More details are in dependent bug: BZ1875363




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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 11 errata-xmlrpc 2021-05-18 15:31:49 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 (java-1.8.0-openjdk 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-2021:1795