OpenJDK / amber / amber
changeset 297:bec12c857972
6682417: JCK test failed w/ ProviderException when decrypted data is not multiple of blocks
Summary: Check for CKR_ENCRYPTED_DATA_LEN_RANGE and throw IllegalBlockSizeException
Reviewed-by: wetmore
author | valeriep |
---|---|
date | Mon, 31 Mar 2008 16:16:12 -0700 |
parents | a26e4ea2ca63 |
children | bae6558c1edd |
files | jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Mon Mar 31 16:12:37 2008 -0700 +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Cipher.java Mon Mar 31 16:16:12 2008 -0700 @@ -817,7 +817,8 @@ if (errorCode == CKR_BUFFER_TOO_SMALL) { throw (ShortBufferException) (new ShortBufferException().initCause(e)); - } else if (errorCode == CKR_DATA_LEN_RANGE) { + } else if (errorCode == CKR_DATA_LEN_RANGE || + errorCode == CKR_ENCRYPTED_DATA_LEN_RANGE) { throw (IllegalBlockSizeException) (new IllegalBlockSizeException(e.toString()).initCause(e)); }