Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -63,6 +63,12 @@ namespace System.Web.Security {
hashAlgorithm = CryptoAlgorithms.CreateSHA1();
else if (StringUtil.EqualsIgnoreCase(passwordFormat, "md5"))
hashAlgorithm = CryptoAlgorithms.CreateMD5();
else if (StringUtil.EqualsIgnoreCase(passwordFormat, "sha256"))
hashAlgorithm = CryptoAlgorithms.CreateSHA256();
else if (StringUtil.EqualsIgnoreCase(passwordFormat, "sha384"))
hashAlgorithm = CryptoAlgorithms.CreateSHA384();
else if (StringUtil.EqualsIgnoreCase(passwordFormat, "sha512"))
hashAlgorithm = CryptoAlgorithms.CreateSHA512();
else
throw new ArgumentException(SR.GetString(SR.InvalidArgumentValue, "passwordFormat"));
@ -346,6 +352,15 @@ namespace System.Web.Security {
#pragma warning disable 618 // HashPasswordForStorignInConfigFile is now obsolete
switch (settings.Forms.Credentials.PasswordFormat)
{
case FormsAuthPasswordFormat.SHA256:
encPassword = HashPasswordForStoringInConfigFile(password, "sha256");
break;
case FormsAuthPasswordFormat.SHA384:
encPassword = HashPasswordForStoringInConfigFile(password, "sha384");
break;
case FormsAuthPasswordFormat.SHA512:
encPassword = HashPasswordForStoringInConfigFile(password, "sha512");
break;
case FormsAuthPasswordFormat.SHA1:
encPassword = HashPasswordForStoringInConfigFile(password, "sha1");
break;