JDK-8309569 : sun/security/pkcs11/Signature/TestRSAKeyLength.java fails after JDK-8301553
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto:pkcs11
  • Affected Version: 21
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: x86_64
  • Submitted: 2023-06-06
  • Updated: 2023-06-13
  • Resolved: 2023-06-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b26Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8309570 :  
Description
The following test failed in the JDK21 CI:

sun/security/pkcs11/Signature/TestRSAKeyLength.java

Here's a snippet from the macosx-x64 sighting:

#section:main
----------messages:(7/307)----------
command: main TestRSAKeyLength
reason: User specified action: run main/othervm TestRSAKeyLength 
started: Tue Jun 06 21:21:07 GMT 2023
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules jdk.crypto.cryptoki
finished: Tue Jun 06 21:21:10 GMT 2023
elapsed time (seconds): 2.829
----------configuration:(3/47)----------
Boot Layer
  add modules: jdk.crypto.cryptoki

----------System.out:(4/291)----------
Beginning test run TestRSAKeyLength...
nssLibDir: /System/Volumes/Data/mesos/work_dir/jib-master/install/jpg/tests/jdk/nsslib/nsslib-macosx_x64/3.46/nsslib-macosx_x64-3.46.zip/nsslib/
Running test with provider SunPKCS11-NSS (security manager disabled) ...
Testing RSA signature SHA1withRSA
----------System.err:(26/1633)----------
java.security.ProviderException: cancel failed
	at jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.cancelOperation(P11Signature.java:338)
	at jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.reset(P11Signature.java:278)
	at jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:497)
	at java.base/java.security.Signature$Delegate.engineInitSign(Signature.java:1357)
	at java.base/java.security.Signature.initSign(Signature.java:636)
	at java.base/java.security.SignedObject.sign(SignedObject.java:250)
	at java.base/java.security.SignedObject.<init>(SignedObject.java:168)
	at TestRSAKeyLength.main(TestRSAKeyLength.java:89)
	at PKCS11Test.premain(PKCS11Test.java:178)
	at PKCS11Test.testNSS(PKCS11Test.java:554)
	at PKCS11Test.main(PKCS11Test.java:214)
	at TestRSAKeyLength.main(TestRSAKeyLength.java:47)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ARGUMENTS_BAD
	at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.C_VerifyFinal(Native Method)
	at jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.cancelOperation(P11Signature.java:312)
	... 15 more

JavaTest Message: Test threw exception: java.security.ProviderException: cancel failed
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.security.ProviderException: cancel failed
----------rerun:(37/8504)*----------
Comments
Changeset: 760cb04a Author: Martin Balao <mbalao@openjdk.org> Date: 2023-06-08 01:24:26 +0000 URL: https://git.openjdk.org/jdk/commit/760cb04a2e099a3af9199d77a234af75a18cce5d
08-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14369 Date: 2023-06-07 20:24:12 +0000
07-06-2023

I'm working on this issue. The cause of the problem is know. I'll propose a fix soon.
07-06-2023

When this bug is fixed, the ProblemList entry needs to be restored to: sun/security/pkcs11/Signature/TestRSAKeyLength.java 8295343 linux-all if JDK-8295343 is still unresolved.
06-06-2023