jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java
changeset 21837 0c41fa97176a
parent 20752 f0f0acea9113
--- a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java	Tue Nov 19 22:28:12 2013 +0100
+++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java	Tue Nov 19 15:29:56 2013 -0800
@@ -186,29 +186,15 @@
                 byte[] plain, int plainOffset)
     {
         int i;
-        byte[] cipherOrig=null;
         int endIndex = cipherOffset + cipherLen;
 
-        if (cipher==plain && (cipherOffset >= plainOffset)
-            && ((cipherOffset - plainOffset) < blockSize)) {
-            // Save the original ciphertext blocks, so they can be
-            // stored in the feedback register "r".
-            // This is necessary because in this constellation, a
-            // ciphertext block (or parts of it) will be overridden by
-            // the plaintext result.
-            cipherOrig = cipher.clone();
-        }
         for (; cipherOffset < endIndex;
              cipherOffset += blockSize, plainOffset += blockSize) {
             embeddedCipher.decryptBlock(cipher, cipherOffset, k, 0);
             for (i = 0; i < blockSize; i++) {
                 plain[i+plainOffset] = (byte)(k[i] ^ r[i]);
             }
-            if (cipherOrig==null) {
-                System.arraycopy(cipher, cipherOffset, r, 0, blockSize);
-            } else {
-                System.arraycopy(cipherOrig, cipherOffset, r, 0, blockSize);
-            }
+            System.arraycopy(cipher, cipherOffset, r, 0, blockSize);
         }
         return cipherLen;
     }