2004-03-10 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Wed, 10 Mar 2004 20:19:03 +0000 (20:19 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Wed, 10 Mar 2004 20:19:03 +0000 (20:19 -0000)
* FromBase64Transform.cs: Now throws ObjectDisposedException and
return true for CanReuseTransform (as MS implementation).

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

mcs/class/corlib/System.Security.Cryptography/ChangeLog
mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs

index 36e4b5493e3d56d80a03bda07efb0a49bff8c136..7823c76f55f2d38aff727ea5b623859de208075c 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-10  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * FromBase64Transform.cs: Now throws ObjectDisposedException and
+       return true for CanReuseTransform (as MS implementation).
+
 2004-03-09  Atsushi Enomoto  <atsushi@ximian.com>
 
        * DSA.cs : fixed incorrectly modified catch for debugging.
index 8a798cabf07ba70b6bcb8b77d6482b5e10286a01..a96315a25ab158255a4794c5feb2462c44de1bba 100644 (file)
@@ -53,16 +53,12 @@ namespace System.Security.Cryptography {
                }
 
 
-               /// <summary>
-               /// </summary>
                public bool CanTransformMultipleBlocks {
-                       get {
-                               return false;
-                       }
+                       get { return false; }
                }
 
                public virtual bool CanReuseTransform {
-                       get { return false; }
+                       get { return true; }
                }
 
                /// <summary>
@@ -135,8 +131,8 @@ namespace System.Security.Cryptography {
                        return ptr;
                }
 
-
                private byte [] lookupTable; 
+
                private byte lookup(byte input) {
                        byte ret;
                        if ((input >= lookupTable.Length) || 
@@ -212,6 +208,9 @@ namespace System.Security.Cryptography {
                                                   byte [] outputBuffer,
                                                   int outputOffset)
                {
+                       if (m_disposed)
+                               throw new ObjectDisposedException ("FromBase64Transform");
+
                        int n;
                        byte [] src;
                        int srcOff;
@@ -242,7 +241,6 @@ namespace System.Security.Cryptography {
                                res = DoTransform (tmpBuff, 0, count & (~3), outputBuffer, outputOffset) ;
                        }
 
-
                        return res;
                }
 
@@ -253,6 +251,9 @@ namespace System.Security.Cryptography {
                                                            int inputOffset,
                                                            int inputCount)
                {
+                       if (m_disposed)
+                               throw new ObjectDisposedException ("FromBase64Transform");
+
                        byte [] src;
                        int srcOff;
                        int n;
@@ -267,7 +268,6 @@ namespace System.Security.Cryptography {
                                srcOff = inputOffset;
                        }
 
-
                        int dataLen = accPtr + n;
                        byte [] tmpBuf = new byte [dataLen];
 
@@ -292,8 +292,9 @@ namespace System.Security.Cryptography {
 
                                Array.Copy (res, newres, actLen);
                                return newres;
-                       } else
-                       return res;
+                       } 
+                       else
+                               return res;
                }
 
        } // FromBase64Transform