Merge pull request #9681 from open-sausages/pulls/4/better-hash-compare-function

BUG Make PasswordEncryptor::check more resistent to timing attacks
This commit is contained in:
Daniel Hensby 2020-09-10 18:23:22 +01:00 committed by GitHub
commit b592d2105c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -100,6 +100,6 @@ abstract class PasswordEncryptor
*/
public function check($hash, $password, $salt = null, $member = null)
{
return $hash === $this->encrypt($password, $salt, $member);
return hash_equals($hash, $this->encrypt($password, $salt, $member));
}
}