Skip to content

Commit 3aab2ec

Browse files
committed
no message
1 parent ee148f2 commit 3aab2ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Str.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ private static function strcmp($knownHash, $givenHash)
6161
*
6262
* @param string $known The string of known length to compare against
6363
* @param string $given The string that the user can control
64-
* @param bool $hash_equals Use hash_equals() if available
6564
*
6665
* @return bool
6766
*/
68-
public static function equal($known, $given, $hash_equals = true)
67+
public static function equal($known, $given)
6968
{
7069
// We hash the 2 inputs at this point because hash_equals is still
7170
// vulnerable to timing attacks when the inputs have different sizes.
@@ -75,7 +74,7 @@ public static function equal($known, $given, $hash_equals = true)
7574
$known = \hash_hmac('sha256', (string) $known, $nonce, true);
7675
$given = \hash_hmac('sha256', (string) $given, $nonce, true);
7776

78-
if ($hash_equals === true && \function_exists('hash_equals')) {
77+
if (\function_exists('hash_equals')) {
7978
return \hash_equals($known, $given); // @codeCoverageIgnore
8079
}
8180

0 commit comments

Comments
 (0)