Browse Source

Fix (likely copy-paste) typo on FormsAuthPasswordFormat

* System.Web.Security/FormsAuthentication.cs: Fix typo (MD5->SHA1).
I suspect the later is not used very much by mono users

* Test/System.Web.Security/FormsAuthenticationTest.cs: Small change to
make sure the hash name is not case sensitive
Sebastien Pouliot 15 years ago
parent
commit
f9d87bdedd

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

@@ -230,7 +230,7 @@ namespace System.Web.Security
 				password = HashPasswordForStoringInConfigFile (password, FormsAuthPasswordFormat.MD5);
 				break;
 			case FormsAuthPasswordFormat.SHA1:
-				password = HashPasswordForStoringInConfigFile (password, FormsAuthPasswordFormat.MD5);
+				password = HashPasswordForStoringInConfigFile (password, FormsAuthPasswordFormat.SHA1);
 				break;
 			}
 

+ 2 - 2
mcs/class/System.Web/Test/System.Web.Security/FormsAuthenticationTest.cs

@@ -87,7 +87,7 @@ namespace MonoTests.System.Web.Security
 
 			// ä (C3-A4)
 			s = Encoding.UTF8.GetString (new byte [2] { 0xC3, 0xA4 });
-			Assert.AreEqual ("8419B71C87A225A2C70B50486FBEE545", FormsAuthentication.HashPasswordForStoringInConfigFile (s, "MD5"));
+			Assert.AreEqual ("8419B71C87A225A2C70B50486FBEE545", FormsAuthentication.HashPasswordForStoringInConfigFile (s, "md5"));
 		}
 
 		[Test]
@@ -99,7 +99,7 @@ namespace MonoTests.System.Web.Security
 
 			// ä (C3-A4)
 			s = Encoding.UTF8.GetString (new byte [2] { 0xC3, 0xA4 });
-			Assert.AreEqual ("961FA22F61A56E19F3F5F8867901AC8CF5E6D11F", FormsAuthentication.HashPasswordForStoringInConfigFile (s, "SHA1"));
+			Assert.AreEqual ("961FA22F61A56E19F3F5F8867901AC8CF5E6D11F", FormsAuthentication.HashPasswordForStoringInConfigFile (s, "sha1"));
 		}
 
 		[Test]