From a0c6a1f591c11fc6cf285b9a678224d5098706e0 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Thu, 28 Jul 2022 10:46:43 -0400 Subject: [PATCH] Fix the P11Cipher AES/ECB/PKCS5Padding array index out of range issue Signed-off-by: Tao Liu --- .../share/classes/sun/security/pkcs11/P11Cipher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java index 8b798a51be5..a4ef5cd81c5 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java @@ -604,7 +604,7 @@ private int implUpdate(byte[] in, int inOfs, int inLen, if (padBufferLen != 0) { if (padBufferLen != padBuffer.length) { int bufCapacity = padBuffer.length - padBufferLen; - if (inLen > bufCapacity) { + if (inLen >= bufCapacity) { bufferInputBytes(in, inOfs, bufCapacity); inOfs += bufCapacity; inLen -= bufCapacity;