Skip to content

Commit 8b3b0a4

Browse files
committed
fix order of hash_equals
1 parent d32e101 commit 8b3b0a4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

api.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7528,11 +7528,7 @@ private function getVerifiedClaims(string $token, int $time, int $leeway, int $t
75287528
switch ($algorithm[0]) {
75297529
case 'H':
75307530
$hash = hash_hmac($hmac, $data, $secret, true);
7531-
if (function_exists('hash_equals')) {
7532-
$equals = hash_equals($signature, $hash);
7533-
} else {
7534-
$equals = $signature == $hash;
7535-
}
7531+
$equals = hash_equals($hash, $signature);
75367532
if (!$equals) {
75377533
return array();
75387534
}

0 commit comments

Comments
 (0)