Author: spouliot
Date: 2007-05-11 16:48:42 -0400 (Fri, 11 May 2007)
New Revision: 77262

Modified:
   trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog
   trunk/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
Log:
2007-05-11  Sebastien Pouliot  <[EMAIL PROTECTED]> 

        * CryptoStream.cs: Ensure TransformFinalBlock isn't called multiple 
        times. Fix bug #81597.



Modified: trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog       
2007-05-11 20:47:54 UTC (rev 77261)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog       
2007-05-11 20:48:42 UTC (rev 77262)
@@ -1,3 +1,8 @@
+2007-05-11  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * CryptoStream.cs: Ensure TransformFinalBlock isn't called multiple 
+       times. Fix bug #81597.
+
 2007-05-10  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * SHA1CryptoServiceProvider.cs: Reduce by half the number of required

Modified: trunk/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs 
2007-05-11 20:47:54 UTC (rev 77261)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs 
2007-05-11 20:48:42 UTC (rev 77262)
@@ -198,11 +198,14 @@
                                                        length += transformed;
                                                        _transformedCount += 
transformed;
                                                }
-                                               byte[] input = 
_transform.TransformFinalBlock (_waitingBlock, 0, _waitingCount);
-                                               transformed = input.Length;
-                                               Buffer.BlockCopy (input, 0, 
_transformedBlock, _transformedCount, input.Length);
-                                               // zeroize this last block
-                                               Array.Clear (input, 0, 
input.Length);
+                                               if (!_flushedFinalBlock) {
+                                                       byte[] input = 
_transform.TransformFinalBlock (_waitingBlock, 0, _waitingCount);
+                                                       transformed = 
input.Length;
+                                                       Buffer.BlockCopy 
(input, 0, _transformedBlock, _transformedCount, input.Length);
+                                                       // zeroize this last 
block
+                                                       Array.Clear (input, 0, 
input.Length);
+                                                       _flushedFinalBlock = 
true;
+                                               }
                                        }
 
                                        length += transformed;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to