Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private static function verify($msg, $signature, $key, $alg)
case 'hash_hmac':
default:
$hash = \hash_hmac($algorithm, $msg, $key, true);
return self::constantTimeEquals($signature, $hash);
return self::constantTimeEquals($hash, $signature);
}
}

Expand Down Expand Up @@ -420,8 +420,8 @@ private static function getKey($keyOrKeyArray, $kid = null)
}

/**
* @param string $left
* @param string $right
* @param string $left The string of known length to compare against
* @param string $right The user-supplied string
* @return bool
*/
public static function constantTimeEquals($left, $right)
Expand Down