hello all,

the attached patch --already committed-- fixes a bug in Cipher which prevented 
SPIs initialised for key wrapping and unwrapping to receive the call.


2006-07-16  Raif S. Naffah  <[EMAIL PROTECTED]>

        * javax/crypto/Cipher.java (getOutputSize): Allow SPIs initialised for 
key
        wrapping/unwrapping to invoke their engineGetOutputSize.


cheers;
rsn
Index: Cipher.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/crypto/Cipher.java,v
retrieving revision 1.5
diff -u -r1.5 Cipher.java
--- Cipher.java	11 Mar 2006 05:21:58 -0000	1.5
+++ Cipher.java	16 Jul 2006 03:19:43 -0000
@@ -639,13 +639,7 @@
   public final int getOutputSize(int inputLength) throws IllegalStateException
   {
     if (cipherSpi == null)
-      {
-        return inputLength;
-      }
-    if (state != ENCRYPT_MODE && state != DECRYPT_MODE)
-      {
-        throw new IllegalStateException("neither encrypting nor decrypting");
-      }
+      return inputLength;
     return cipherSpi.engineGetOutputSize(inputLength);
   }

Reply via email to