Fixing timing attack vuln. on HMAC comparison (#409)
This commit is contained in:
parent
a35788da34
commit
5cc28a0716
1 changed files with 1 additions and 1 deletions
|
@ -170,7 +170,7 @@ class HMACAuthorization
|
|||
*/
|
||||
protected function validateContents()
|
||||
{
|
||||
if (base64_decode($this->hash()) !== $this->generateSignature()) {
|
||||
if (! hash_equals(base64_decode($this->hash()), $this->generateSignature())) {
|
||||
throw new BadRequestHttpException('The HMAC for the request was invalid.');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue