JDK-8349849 : PKCS11 SunTlsKeyMaterial crashes when used with TLS1.2 TlsKeyMaterialParameterSpec
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto:pkcs11
  • Affected Version: 8,25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-11
  • Updated: 2025-06-03
  • Resolved: 2025-03-10
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 17 JDK 21 JDK 25
17.0.17-oracleUnresolved 21.0.9-oracleUnresolved 25 b14Fixed
Related Reports
Causes :  
Description
The crash happens in JNI code and is reproducible with all PKCS11 backends that support SunTlsKeyMaterial. Example crash report:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffb6ed3abba, pid=18548, tid=2760
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (build 25-internal-adhoc.daniel.jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25-internal-adhoc.daniel.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0x48abba]  jni_GetObjectField+0xea

the crash is caused by a mismatch between the mechanism and the parameter object type. Reproducer based on the existing PKCS11Test attached.
Comments
Changeset: 84f71dd6 Branch: master Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2025-03-10 07:52:11 +0000 URL: https://git.openjdk.org/jdk/commit/84f71dd6247bbaca508e0a6f04c5b201a1974266
10-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23583 Date: 2025-02-12 10:02:55 +0000
12-02-2025