List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:December 14 2010 10:56pm
Subject:bzr commit into connector-net-6.0 branch (reggie.burnett:856) Bug#58906
View as plain text  
#At file:///C:/Documents%20and%20Settings/Reggie/work/connector-net/6.0/ based on revid:reggie.burnett@stripped

  856 Reggie Burnett	2010-12-14
      - fixed MembershipProvider to properly set a hash key when using a keyed hash alogrithm (bug #58906)

    modified:
      CHANGES
      MySql.Web/Providers/Source/MembershipProvider.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2010-12-14 22:26:14 +0000
+++ b/CHANGES	2010-12-14 22:56:36 +0000
@@ -18,6 +18,7 @@
 - removed extra call to Update in MySqlDataAdapter introduced with bug fix to bug #54863.
   It seems to not be necessary (bug #58853)
 - fixed unnecessary string code in MySqlTokenizer (bug #58757)
+- fixed MembershipProvider to properly set a hash key when using a keyed hash alogrithm (bug #58906)
 
 Version 6.0.7
 - Fix authorization popup after modifying stored procedure in VS (Bug #44715)

=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
--- a/MySql.Web/Providers/Source/MembershipProvider.cs	2010-08-06 10:26:14 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs	2010-12-14 22:56:36 +0000
@@ -1225,9 +1225,15 @@
         /// </summary>
         /// <param name="bytes"></param>
         /// <returns></returns>
-        private string HashPasswordBytes(byte[] bytes)
+        private string HashPasswordBytes(byte[] key, byte[] bytes)
         {
             HashAlgorithm hash = HashAlgorithm.Create(Membership.HashAlgorithmType);
+
+            if (hash is KeyedHashAlgorithm)
+            {
+                KeyedHashAlgorithm keyedHash = hash as KeyedHashAlgorithm;
+                keyedHash.Key = key;
+            }
             return Convert.ToBase64String(hash.ComputeHash(bytes));
         }
 
@@ -1251,7 +1257,7 @@
                 return Convert.ToBase64String(encryptedBytes);
             }
             else if (format == MembershipPasswordFormat.Hashed)
-                return HashPasswordBytes(keyedBytes);
+                return HashPasswordBytes(keyBytes, keyedBytes);
             else
                 throw new ProviderException(Resources.UnsupportedPasswordFormat);
         }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20101214225636-vowtse147fdpt2e9.bundle
Thread
bzr commit into connector-net-6.0 branch (reggie.burnett:856) Bug#58906Reggie Burnett14 Dec