mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
b592d2105c
@ -100,6 +100,6 @@ abstract class PasswordEncryptor
|
|||||||
*/
|
*/
|
||||||
public function check($hash, $password, $salt = null, $member = null)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user