RFR: 8365883: Fix P11Cipher to throw BadPaddingException for PKCS11 CKR_ENCRYPTED_DATA_INVALID error

Mikhail Yankelevich myankelevich at openjdk.org
Fri Jan 30 20:15:41 UTC 2026


Underlying issue: if provider returns `PKCS11Exception: CKR_ENCRYPTED_DATA_INVALID` instead of BadPaddingException - `java.security.ProviderException: doFinal()` is thrown

-------------

Commit messages:
 - JDK-8365883: Handle CKR_ENCRYPTED_DATA_INVALID for AES, DES and DES3 for providers correctly

Changes: https://git.openjdk.org/jdk/pull/29503/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29503&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8365883
  Stats: 28 lines in 2 files changed: 17 ins; 2 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/29503.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29503/head:pull/29503

PR: https://git.openjdk.org/jdk/pull/29503


More information about the security-dev mailing list