Explorar o código

2005-05-21 Sebastien Pouliot <[email protected]>

	* FormsAuthentication.cs: Hash the UTF8 representation of the password
	strings (to be compatible with Microsoft implementation).


svn path=/trunk/mcs/; revision=44878
Sebastien Pouliot %!s(int64=20) %!d(string=hai) anos
pai
achega
91a3fc7f3a

+ 5 - 0
mcs/class/System.Web/System.Web.Security/ChangeLog

@@ -1,3 +1,8 @@
+2005-05-21  Sebastien Pouliot  <[email protected]>
+
+	* FormsAuthentication.cs: Hash the UTF8 representation of the password
+	strings (to be compatible with Microsoft implementation).
+
 2005-04-20 Gonzalo Paniagua Javier <[email protected]>
 
 	* FormsAuthentication.cs:

+ 2 - 2
mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs

@@ -237,9 +237,9 @@ namespace System.Web.Security
 
 			byte [] bytes;
 			if (String.Compare (passwordFormat, "MD5", true) == 0) {
-				bytes = MD5.Create ().ComputeHash (Encoding.ASCII.GetBytes (password));
+				bytes = MD5.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
 			} else if (String.Compare (passwordFormat, "SHA1", true) == 0) {
-				bytes = SHA1.Create ().ComputeHash (Encoding.ASCII.GetBytes (password));
+				bytes = SHA1.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
 			} else {
 				throw new ArgumentException ("The format must be either MD5 or SHA1", "passwordFormat");
 			}