RH2023467: Enable FIPS keys export #6
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Search this PR in Red Hat Jira
ff26db7...0cb2359 (excluding ff26db7)
rh-openjdk:fips← #1 ← #5 ← THIS PRRH2023467: Enable the export of keys in plain from the NSS Software Token while in FIPS mode
A backport of rh-openjdk/jdk#1, which also includes rh-openjdk/jdk#14 (a follow-up issue found in the first PR).
NOTE: I've created the branch starting from #5's 6afe961 (which is a dependency for certain changes).
References
Pull request creation procedure
git cherry-pick --continueand edit commit messages to remove the original PR numbers from therh-openjdk/jdkrepo, and to add references to the back-ported commit hashesConflicts
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11Exception.javaerrorCode-onlyPKCS11Exceptionconstructor added in rh-openjdk/jdk@abcd095, because this constructor hadn't been added in 8e0ea91, since it was still part of upstream 11u code (since 11u doesn't have JDK-6676643: Improve current C_GetAttributeValue native implementation)src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java"RSA"algorithm of theKeyFactoryservice in FIPS (implemented insun.security.rsa.RSAKeyFactory$Legacy)"RSASSA-PSS"algorithm of theKeyFactoryservice in FIPS (implemented insun.security.rsa.PSSParameters)Additional required changes
Once conflicts were solved, the following changes were required:
P11Key.java:SharedSecretsimport in 11u has to be ofjdk.internal.misc.SharedSecrets, and notjdk.internal.access.SharedSecretsPKCS11.java: changes from 5c8832f require passing an extranullafter rh-openjdk/jdk@bd324bd is appliedFIPSKeyImporter.java: removetypeandformatparameters ofsun.security.rsa.RSAPrivateCrtKeyImpl.newKey()(added in JDK-8023980: JCE doesn't provide any class to handle RSA private key in PKCS#1)import static sun.security.pkcs11.wrapper.PKCS11Exception.*;to adapt code for introduced openjdk/jdk@7ab6dc8 backport (ff26db7)