Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeyer2k committed Feb 20, 2016
1 parent ee148f2 commit 3aab2ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ private static function strcmp($knownHash, $givenHash)
*
* @param string $known The string of known length to compare against
* @param string $given The string that the user can control
* @param bool $hash_equals Use hash_equals() if available
*
* @return bool
*/
public static function equal($known, $given, $hash_equals = true)
public static function equal($known, $given)
{
// We hash the 2 inputs at this point because hash_equals is still
// vulnerable to timing attacks when the inputs have different sizes.
Expand All @@ -75,7 +74,7 @@ public static function equal($known, $given, $hash_equals = true)
$known = \hash_hmac('sha256', (string) $known, $nonce, true);
$given = \hash_hmac('sha256', (string) $given, $nonce, true);

if ($hash_equals === true && \function_exists('hash_equals')) {
if (\function_exists('hash_equals')) {
return \hash_equals($known, $given); // @codeCoverageIgnore
}

Expand Down

0 comments on commit 3aab2ec

Please sign in to comment.