Skip to content

Commit

Permalink
Use timing attack safe string comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Aug 25, 2017
1 parent 91274dd commit bab2dc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Auth/DigestAuthenticate.php
Expand Up @@ -121,7 +121,7 @@ public function getUser(ServerRequest $request)
unset($user[$field]);

$hash = $this->generateResponseHash($digest, $password, $request->getEnv('ORIGINAL_REQUEST_METHOD'));
if ($digest['response'] === $hash) {
if (hash_equals($hash, $digest['response'])) {
return $user;
}

Expand Down

0 comments on commit bab2dc2

Please sign in to comment.