United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6682411 JCK test failed w/ ArrayIndexOutOfBoundException (-1) when decrypting with no data
6682411 : JCK test failed w/ ArrayIndexOutOfBoundException (-1) when decrypting with no data

Details
Type:
Bug
Submit Date:
2008-03-31
Status:
Closed
Updated Date:
2011-05-17
Project Name:
JDK
Resolved Date:
2011-05-17
Component:
security-libs
OS:
solaris
Sub-Component:
javax.crypto:pkcs11
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports
Backport:
Backport:

Sub Tasks

Description
The current PKCS5Padding implementation in SunPKCS11 provider assumes that there is at least one padding byte available. However, this assumption isn't true when the user calles doFinal() without any data in decrypt mode. Certain classes, e.g. javax.crypto.CipherInput/OutputStream, use an empty doFinal() call as a way to discard the remaining data when its close() is called.

For scenarios like this, the method should throw BadPaddingException instead of ArrayIndexOutOfBoundException.

                                    

Comments
EVALUATION

will fix
                                     
2008-03-31



Hardware and Software, Engineered to Work Together