eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.24k stars 713 forks source link

openJcePlusTests_0_FAILED com.ibm.crypto.plus.provider.ock.OCKException: Context is not in FIPS mode #19644

Open JasonFengJ9 opened 1 month ago

JasonFengJ9 commented 1 month ago

Failure link

From an internal build(svlxtor3):

02:58:45  openjdk version "22.0.1-beta" 2024-04-16
02:58:45  IBM Semeru Runtime Open Edition 22.0.1+8-202406050453 (build 22.0.1-beta+8-202406050453)
02:58:45  Eclipse OpenJ9 VM 22.0.1+8-202406050453 (build master-228602c60d, JRE 22 Linux s390x-64-Bit Compressed References 20240605_83 (JIT enabled, AOT enabled)
02:58:45  OpenJ9   - 228602c60d
02:58:45  OMR      - a3bc75a88
02:58:45  JCL      - 0e12d35c8 based on jdk-22.0.1+8)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2024-06-05T06:58:45.084Z] variation: NoOptions
[2024-06-05T06:58:45.084Z] JVM_OPTIONS:  

[2024-06-05T07:01:29.293Z]      [test]     [junit] ====================================================================================
[2024-06-05T07:01:29.293Z]      [test]     [junit] ================  NEW TEST #750  =====================================================
[2024-06-05T07:01:29.293Z]      [test]     [junit] ====================================================================================
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS():  RSA KEY LENGTH = 512
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS():  dataToBeSigned = long
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): signingProvidersSignatureAlgorithmName   = RSAPSS
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): verifyingProvidersSignatureAlgorithmName = RSAPSS
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): signingProviderName                      = OpenJCEPlus
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): verifyingProviderName                    = OpenJCEPlus
[2024-06-05T07:01:29.293Z]      [test]     [junit] 
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): PSSParameterSpec.mdName           = "SHA512"
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): PSSParameterSpec.mgfName          = "MGF1"
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): PSSParameterSpec.MGFParameterSpec = MGF1ParameterSpec.SHA512
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): PSSParameterSpec.saltLen          = 20
[2024-06-05T07:01:29.293Z]      [test]     [junit] testRSAPSS(): PSSParameterSpec.trailerField     = 1023
[2024-06-05T07:01:29.293Z]      [test]     [junit] Test finished: ibm.jceplus.junit.openjceplus.multithread.TestMiniRSAPSS2
[2024-06-05T07:01:29.293Z]      [test]     [junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 155.651 sec
[2024-06-05T07:01:29.293Z]      [test]      [echo] TestMultithread COMPLETED
[2024-06-05T07:01:29.293Z]      [test]      [echo] Command: ${TEST_JAVA} -cp junit4.jar:hamcrest-core.jar:bcprov-jdk18on.jar:openjceplus-tests.jar --add-exports=java.base/sun.security.util=ALL-UNNAMED --add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED ibm.jceplus.junit.TestMultiThreadFIPS
[2024-06-05T07:01:29.293Z]      [test]     [junit] Running ibm.jceplus.junit.TestMultithreadFIPS
[2024-06-05T07:01:30.026Z]      [test]     [junit] #threads=10 timeout=1500
[2024-06-05T07:01:30.026Z]      [test]     [junit] Test calling: ibm.jceplus.junit.openjceplusfips.multithread.TestAliases
[2024-06-05T07:01:44.542Z]      [test]     [junit] java.security.ProviderException: Failed to initialize OpenJCEPlusFIPS provider
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.OpenJCEPlusFIPS.providerException(OpenJCEPlusFIPS.java:817)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.OpenJCEPlusFIPS.initializeContext(OpenJCEPlusFIPS.java:759)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.OpenJCEPlusFIPS$1.run(OpenJCEPlusFIPS.java:87)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.security.AccessController.doPrivileged(AccessController.java:692)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.OpenJCEPlusFIPS.<init>(OpenJCEPlusFIPS.java:79)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:132)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:259)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.Class.newInstance(Class.java:2425)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.base.BaseUtils.loadProvider(BaseUtils.java:135)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.base.BaseUtils.loadProvider(BaseUtils.java:125)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.base.BaseUtils.loadProviderOpenJCEPlusFIPS(BaseUtils.java:162)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.openjceplusfips.Utils.loadProviderTestSuite(Utils.java:23)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.openjceplusfips.multithread.TestAliases.<clinit>(TestAliases.java:34)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.Class.forNameImpl(Native Method)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.Class.forName(Class.java:372)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.Class.forName(Class.java:350)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.TestMultithreadFIPS.testToRunnable(TestMultithreadFIPS.java:114)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at ibm.jceplus.junit.TestMultithreadFIPS.testMultithreadFIPS(TestMultithreadFIPS.java:136)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestCase.runTest(TestCase.java:168)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestCase.runBare(TestCase.java:134)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestResult$1.protect(TestResult.java:110)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestResult.runProtected(TestResult.java:128)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestResult.run(TestResult.java:113)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestCase.run(TestCase.java:124)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestSuite.runTest(TestSuite.java:243)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at junit.framework.TestSuite.run(TestSuite.java:238)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1196)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1041)
[2024-06-05T07:01:44.542Z]      [test]     [junit] Caused by: com.ibm.crypto.plus.provider.ock.OCKException: Context is not in FIPS mode
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.ock.NativeInterface.initializeOCK(Native Method)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.ock.OCKContext.createContext(OCKContext.java:38)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  at openjceplus/com.ibm.crypto.plus.provider.OpenJCEPlusFIPS.initializeContext(OpenJCEPlusFIPS.java:756)
[2024-06-05T07:01:44.542Z]      [test]     [junit]  ... 31 more
[2024-06-05T07:01:44.542Z]      [test]     [junit] Running ibm.jceplus.junit.TestMultithreadFIPS
[2024-06-05T07:01:44.542Z]      [test]     [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
[2024-06-05T07:01:44.542Z]      [test] 
[2024-06-05T07:01:44.542Z]      [test] BUILD FAILED
[2024-06-05T07:01:44.542Z]      [test] /home/jenkins/workspace/Test_openjdk22_j9_extended.functional_s390x_linux_testList_0/jvmtest/functional/OpenJcePlusTests/test.xml:75: Test ibm.jceplus.junit.TestMultithreadFIPS failed (crashed)
[2024-06-05T07:01:44.542Z]      [test] 
[2024-06-05T07:01:44.542Z]      [test] Total time: 2 minutes 57 seconds
[2024-06-05T07:01:44.542Z] 
[2024-06-05T07:01:44.542Z] BUILD FAILED
[2024-06-05T07:01:44.542Z] /home/jenkins/workspace/Test_openjdk22_j9_extended.functional_s390x_linux_testList_0/jvmtest/functional/OpenJcePlusTests/test.xml:35: Java returned: 1
[2024-06-05T07:01:44.542Z] 
[2024-06-05T07:01:44.543Z] Total time: 2 minutes 58 seconds
[2024-06-05T07:01:44.543Z] -----------------------------------
[2024-06-05T07:01:44.543Z] openJcePlusTests_0_FAILED

50x internal grinder - the original failure wasn't reproduced

FYI @jasonkatonica @KostasTsiounis

jasonkatonica commented 1 month ago

Hi @JasonFengJ9 This problem is a known issue on platform z. There is a self entropy check that fails upon loading of the dll on s390x architectures. This is being worked on by a few teams and is the main reason at this time that we will not be entering production with the FIPS 140-3 solution on z at this time.