2007-03-22 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Mar 2007 19:16:09 +0000 (19:16 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Mar 2007 19:16:09 +0000 (19:16 -0000)
* SymmetricTransform.cs: Before 2.0 an IndexOutOfRangeException was
thrown (for all unmanaged transforms) in case of an overflow.

svn path=/trunk/mcs/; revision=74826

mcs/class/corlib/Mono.Security.Cryptography/ChangeLog
mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs

index cb3184903a89c189abc475182ef93738aa9ebd7e..22909774a3427442a280189d950e2c29a15d918d 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-22  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * SymmetricTransform.cs: Before 2.0 an IndexOutOfRangeException was 
+       thrown (for all unmanaged transforms) in case of an overflow.
+
 2007-03-05  Sebastien Pouliot  <sebastien@ximian.com>
 
        * SymmetricTransform.cs: Fix KeepLastBlock to be true for decryption 
index 0b151546d3fb890391ed5423d42c37747c9b7c67..5fc4cacc1c2a292e654698a9b259abf0dea11324 100644 (file)
@@ -247,8 +247,13 @@ namespace Mono.Security.Cryptography {
                        if (!encrypt && (0 > len) && ((algo.Padding == PaddingMode.None) || (algo.Padding == PaddingMode.Zeros))) {
                                throw new CryptographicException ("outputBuffer", Locale.GetText ("Overflow"));
                        } else  if (KeepLastBlock) {
-                               if (0 > len + BlockSizeByte)
+                               if (0 > len + BlockSizeByte) {
+#if NET_2_0
                                        throw new CryptographicException ("outputBuffer", Locale.GetText ("Overflow"));
+#else
+                                       throw new IndexOutOfRangeException (Locale.GetText ("Overflow"));
+#endif
+                               }
                        } else {
                                if (0 > len) {
                                        // there's a special case if this is the end of the decryption process