changeset 157:c063b7fb55f7

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 17e93b7fb97d
children 99b3301fc27c
files src/share/classes/sun/security/pkcs11/P11Cipher.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/pkcs11/P11Cipher.java	Mon Mar 31 16:12:37 2008 -0700
+++ b/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));
         }