Stop throwing format exceptions when password hash isn't valid

This commit is contained in:
2013-02-12 18:08:38 -05:00
parent e6d911cb05
commit e2498b5270
2 changed files with 26 additions and 2 deletions
+10 -1
View File
@@ -47,7 +47,16 @@ namespace MileageTraker.Web.Utility
if (password == null)
throw new ArgumentNullException("password");
var hashedPasswordBytes = Convert.FromBase64String(hashedPassword);
byte[] hashedPasswordBytes;
try
{
hashedPasswordBytes = Convert.FromBase64String(hashedPassword);
}
catch (FormatException)
{
return false;
}
// Verify a version 0 (see comment above) password hash.