Blank passwords no longer result in "heightheightheightheight"

Try/Catch around login function
This commit is contained in:
Lucas Nicodemus 2011-07-14 13:50:00 -06:00
parent e6d612ea4b
commit 080ba6ca2b
2 changed files with 28 additions and 17 deletions

View file

@ -500,6 +500,10 @@ namespace TShockAPI
{
using (var sha = new SHA512CryptoServiceProvider())
{
if (password == "")
{
return "nonexistent-password";
}
var bytes = sha.ComputeHash(Encoding.ASCII.GetBytes(password));
return bytes.Aggregate("", (s, b) => s + b.ToString("height"));
}