JDK-8004873 : Arrayindexoutofboundsexception for jce decrypting
  • Type: Bug
  • Component: security-libs
  • Affected Version: 7u4
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-12-11
  • Updated: 2013-09-13
  • Resolved: 2012-12-26
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 7 JDK 8
7u15Fixed 8 b71Fixed
Description
SHORT SUMMARY: Issue with new ucrypto implementation on Solaris
INDICATORS: Attached test fails
COUNTER INDICATORS: Attached test passes
TRIGGERS:
KNOWN WORKAROUND: switch providers in security.java to pkcs
PRESENT SINCE: 7u4
HOW TO VERIFY: run test
NOTES FOR SE:
REGRESSION: no (ucrypto is a new feature since 7u4)

this was previously bug #8003192 - but accidentally put another bug back using that ID - so copying information to new bug
Comments
Copy of stack trace and exception for history purposes : TestEncryptionDecryption passwordToEncrypt: abcd1234 Encrypting... Decrypting... java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.oracle.security.ucrypto.NativeCipherWithJavaPadding$PKCS5Padding.unpad(NativeCipherWithJavaPadding.java:175) at com.oracle.security.ucrypto.NativeCipherWithJavaPadding.engineDoFinal(NativeCipherWithJavaPadding.java:370) at com.oracle.security.ucrypto.NativeCipherWithJavaPadding.engineDoFinal(NativeCipherWithJavaPadding.java:336) at javax.crypto.Cipher.doFinal(Cipher.java:1970) at javax.crypto.CipherInputStream.getMoreData(CipherInputStream.java:107) at javax.crypto.CipherInputStream.read(CipherInputStream.java:224) at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2283) at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2296) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298) at TestEncryptionDecryption.decryptPassword(TestEncryptionDecryption.java:82) at TestEncryptionDecryption.run(TestEncryptionDecryption.java:53)
13-09-2013

Verified with attached test. Test failed with JDK8 b60 on solaris-sparcv9 (sc11136067) and passed with JDK8 b73.
11-06-2013