diff --git a/Core/Utilities/Security/Hashing/HashingHelper.cs b/Core/Utilities/Security/Hashing/HashingHelper.cs index 2d86dbf..45cb2ea 100644 --- a/Core/Utilities/Security/Hashing/HashingHelper.cs +++ b/Core/Utilities/Security/Hashing/HashingHelper.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Collections.Generic; using System.Text; @@ -20,16 +21,8 @@ public static bool VerifyPasswordHash(string password, byte[] passwordHash, byte using (var hmac = new System.Security.Cryptography.HMACSHA512(passwordSalt)) { var computedHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password)); - for (int i = 0; i < computedHash.Length; i++) - { - if (computedHash[i]!=passwordHash[i]) - { - return false; - } - } + return computedHash.SequenceEqual(passwordHash); } - - return true; } } }