Author: spouliot
Date: 2005-04-25 13:22:53 -0400 (Mon, 25 Apr 2005)
New Revision: 43554

Modified:
   trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog
   trunk/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
   trunk/mcs/class/corlib/System.Security.Cryptography/DES.cs
   trunk/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
   trunk/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs
Log:
2005-04-25  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * CryptoConfig.cs: Removed RSA OID and added null check in EncodeOID
        in NET_2_0 to match beta2.
        * DES.cs: Added null check for IsWeakKey and IsSemiWeakKey in NET_2_0
        to match beta2.
        * SymmetricAlgorithm.cs: Throw CryptographicException when feedback is
        zero in NET_2_0 to match beta2
        * TripleDES.cs: Added null check for IsWeakKey in NET_2_0 to match 
        beta2.



Modified: trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog       
2005-04-25 17:08:17 UTC (rev 43553)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/ChangeLog       
2005-04-25 17:22:53 UTC (rev 43554)
@@ -1,3 +1,14 @@
+2005-04-25  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * CryptoConfig.cs: Removed RSA OID and added null check in EncodeOID
+       in NET_2_0 to match beta2.
+       * DES.cs: Added null check for IsWeakKey and IsSemiWeakKey in NET_2_0
+       to match beta2.
+       * SymmetricAlgorithm.cs: Throw CryptographicException when feedback is
+       zero in NET_2_0 to match beta2
+       * TripleDES.cs: Added null check for IsWeakKey in NET_2_0 to match 
+       beta2.
+
 2005-04-05  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * CryptoConfig.cs: Added Assert for FileIOPermission to LoadConfig so 

Modified: trunk/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs 
2005-04-25 17:08:17 UTC (rev 43553)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs 
2005-04-25 17:22:53 UTC (rev 43554)
@@ -115,7 +115,7 @@
        private const string oidSHA384 = "2.16.840.1.101.3.4.2.2";
        private const string oidSHA512 = "2.16.840.1.101.3.4.2.3";
        // new in 2.0
-       private const string oidRSA = "1.2.840.113549.1.1.1";
+//     private const string oidRSA = "1.2.840.113549.1.1.1";
        private const string oidDSA = "1.2.840.10040.4.1";
        private const string oidDES = "1.3.14.3.2.7";
        private const string oid3DES = "1.2.840.113549.3.7";
@@ -344,7 +344,7 @@
                oid.Add (name3DESKeyWrap, oid3DESKeyWrap);
 
 #if NET_2_0
-               oid.Add (nameRSAa, oidRSA);
+//             oid.Add (nameRSAa, oidRSA);
                oid.Add (nameDSAa, oidDSA);
                oid.Add (nameDESa, oidDES);
                oid.Add (name3DESa, oid3DES);
@@ -484,6 +484,10 @@
 
        public static byte[] EncodeOID (string str)
        {
+#if NET_2_0
+               if (str == null)
+                       throw new ArgumentNullException ("str");
+#endif
                char[] delim = { '.' };
                string[] parts = str.Split (delim);
                // according to X.208 n is always at least 2

Modified: trunk/mcs/class/corlib/System.Security.Cryptography/DES.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/DES.cs  2005-04-25 
17:08:17 UTC (rev 43553)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/DES.cs  2005-04-25 
17:22:53 UTC (rev 43554)
@@ -90,6 +90,10 @@
 
        public static bool IsWeakKey (byte[] rgbKey) 
        {
+#if NET_2_0
+               if (rgbKey == null)
+                       throw new CryptographicException (Locale.GetText ("Null 
Key"));
+#endif
                if (rgbKey.Length != keySizeByte)
                        throw new CryptographicException (Locale.GetText 
("Wrong Key Length"));
 
@@ -121,6 +125,10 @@
 
        public static bool IsSemiWeakKey (byte[] rgbKey)
        {
+#if NET_2_0
+               if (rgbKey == null)
+                       throw new CryptographicException (Locale.GetText ("Null 
Key"));
+#endif
                if (rgbKey.Length != keySizeByte)
                        throw new CryptographicException (Locale.GetText 
("Wrong Key Length"));
 

Modified: 
trunk/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs   
2005-04-25 17:08:17 UTC (rev 43553)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs   
2005-04-25 17:22:53 UTC (rev 43554)
@@ -99,7 +99,11 @@
                public virtual int FeedbackSize {
                        get { return this.FeedbackSizeValue; }
                        set {
+#if NET_2_0
+                               if ((value <= 0) || (value > 
this.BlockSizeValue)) {
+#else
                                if (value > this.BlockSizeValue) {
+#endif
                                        throw new CryptographicException (
                                                Locale.GetText ("feedback size 
larger than block size"));
                                }

Modified: trunk/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs
===================================================================
--- trunk/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs    
2005-04-25 17:08:17 UTC (rev 43553)
+++ trunk/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs    
2005-04-25 17:22:53 UTC (rev 43554)
@@ -86,6 +86,10 @@
        //      if ( b == c ) then TripleDES == DES(a) (hence weak key)
        public static bool IsWeakKey (byte[] rgbKey)
        {
+#if NET_2_0
+               if (rgbKey == null)
+                       throw new CryptographicException (Locale.GetText ("Null 
Key"));
+#endif
                // 128 bits (16 bytes) is 3 DES with 2 keys
                if (rgbKey.Length == 16) {
                        // weak if first half == second half

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

Reply via email to