Author: spouliot
Date: 2005-03-30 17:54:01 -0500 (Wed, 30 Mar 2005)
New Revision: 42402

Modified:
   trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
   trunk/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs
Log:
2005-03-30  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * CryptoStreamTest.cs: Added test case when when no padding is used.



Modified: trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog  
2005-03-30 22:48:26 UTC (rev 42401)
+++ trunk/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog  
2005-03-30 22:54:01 UTC (rev 42402)
@@ -1,3 +1,7 @@
+2005-03-30  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * CryptoStreamTest.cs: Added test case when when no padding is used.
+
 2005-03-24  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * CryptoConfigCas.cs: New. CAS unit tests for CryptoConfig.

Modified: 
trunk/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs
===================================================================
--- 
trunk/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs    
    2005-03-30 22:48:26 UTC (rev 42401)
+++ 
trunk/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs    
    2005-03-30 22:54:01 UTC (rev 42402)
@@ -5,7 +5,7 @@
 //     Sebastien Pouliot <[EMAIL PROTECTED]>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -1313,5 +1313,25 @@
                        AssertEquals ("Length", 56, debug.Length);
                        // last block is kept for later processing
                }
+
+               [Test]
+               public void PaddingModeNone ()
+               {
+                       byte[] Key = new byte [16];
+                       byte[] IV = new byte [16];
+                       byte[] Buffer = new byte [64];
+
+                       Rijndael alg = Rijndael.Create ();
+                       alg.Mode = CipherMode.CBC;
+                       alg.Padding = PaddingMode.None;
+
+                       MemoryStream cms = new MemoryStream ();
+                       ICryptoTransform ct = alg.CreateDecryptor (Key, IV);
+                       CryptoStream cs = new CryptoStream (cms, ct, 
CryptoStreamMode.Write);
+                       cs.Write (Buffer, 0, 64);
+                       cs.Close ();
+
+                       AssertEquals ("Length", 64, cms.ToArray ().Length);
+               }
        }
 }

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

Reply via email to