Skip to content

Commit ca0d683

Browse files
committed
Fix the P11Cipher AES/ECB/PKCS5Padding array index out of range issue
Signed-off-by: Tao Liu <[email protected]>
1 parent b399e86 commit ca0d683

File tree

1 file changed

+8
-1
lines changed
  • src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11

1 file changed

+8
-1
lines changed

src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
* or visit www.oracle.com if you need additional information or have any
2323
* questions.
2424
*/
25+
26+
/*
27+
* ===========================================================================
28+
* (c) Copyright IBM Corp. 2022, 2023 All Rights Reserved
29+
* ===========================================================================
30+
*/
31+
2532
package sun.security.pkcs11;
2633

2734
import java.nio.ByteBuffer;
@@ -604,7 +611,7 @@ private int implUpdate(byte[] in, int inOfs, int inLen,
604611
if (padBufferLen != 0) {
605612
if (padBufferLen != padBuffer.length) {
606613
int bufCapacity = padBuffer.length - padBufferLen;
607-
if (inLen > bufCapacity) {
614+
if (inLen >= bufCapacity) {
608615
bufferInputBytes(in, inOfs, bufCapacity);
609616
inOfs += bufCapacity;
610617
inLen -= bufCapacity;

0 commit comments

Comments
 (0)