Skip to content

Commit

Permalink
Strict check
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Mar 5, 2019
1 parent 83259d8 commit 7afbcc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/auth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ static function checkPassword($pass, $hash) {
$ok = password_verify($pass, $hash);

} else if (strlen($hash)==32) {
$ok = md5($pass) == $hash;
$ok = md5($pass) === $hash;

} else if (strlen($hash)==40) {
$ok = sha1($pass) == $hash;
$ok = sha1($pass) === $hash;

} else {
$salt = substr($hash, 0, 8);
$ok = ($salt.sha1($salt.$pass) == $hash);
$ok = ($salt.sha1($salt.$pass) === $hash);
}

return $ok;
Expand Down

0 comments on commit 7afbcc7

Please # to comment.