Author: spouliot
Date: 2007-01-03 12:17:30 -0500 (Wed, 03 Jan 2007)
New Revision: 70428
Modified:
trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
trunk/mcs/class/corlib/Test/System.Security.Cryptography/DESCryptoServiceProviderTest.cs
Log:
2007-01-03 Sebastien Pouliot <[EMAIL PROTECTED]>
* DESCryptoServiceProviderTest.cs: Add tests for bug #80439 where
inputCount is reduced to fit into the output buffer (for any mode).
Modified: trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
2007-01-03 17:15:35 UTC (rev 70427)
+++ trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
2007-01-03 17:17:30 UTC (rev 70428)
@@ -1,3 +1,8 @@
+2007-01-03 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * DESCryptoServiceProviderTest.cs: Add tests for bug #80439 where
+ inputCount is reduced to fit into the output buffer (for any mode).
+
2006-11-24 Sebastien Pouliot <[EMAIL PROTECTED]>
* CryptoConfigTest.cs: Added test case for X509Chain.
Modified:
trunk/mcs/class/corlib/Test/System.Security.Cryptography/DESCryptoServiceProviderTest.cs
===================================================================
---
trunk/mcs/class/corlib/Test/System.Security.Cryptography/DESCryptoServiceProviderTest.cs
2007-01-03 17:15:35 UTC (rev 70427)
+++
trunk/mcs/class/corlib/Test/System.Security.Cryptography/DESCryptoServiceProviderTest.cs
2007-01-03 17:17:30 UTC (rev 70428)
@@ -249,5 +249,38 @@
int size = des.BlockSize; // 8 times too big
CreateDecryptor_IV (size);
}
+
+ public void Bug80439 (CipherMode mode)
+ {
+ des.Mode = mode;
+ ICryptoTransform enc = des.CreateEncryptor ();
+ byte[] plaintext = new byte[56];
+ byte[] encdata = new byte[64];
+ enc.TransformBlock (plaintext, 0, plaintext.Length,
encdata, 0);
+
+ ICryptoTransform dec = des.CreateDecryptor ();
+ byte[] decdata = new byte[56];
+ dec.TransformBlock (encdata, 0, encdata.Length,
decdata, 0);
+
+ Assert.AreEqual (plaintext, decdata, mode.ToString ());
+ }
+
+ [Test]
+ public void PartialDecrypt_CBC ()
+ {
+ Bug80439 (CipherMode.CBC);
+ }
+
+ [Test]
+ public void PartialDecrypt_CFB ()
+ {
+ Bug80439 (CipherMode.CFB);
+ }
+
+ [Test]
+ public void PartialDecrypt_ECB ()
+ {
+ Bug80439 (CipherMode.ECB);
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches