issue-21: actualisation de l'env de dev et maj dépendances
This commit is contained in:
@ -46,20 +46,20 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
|
||||
|
||||
$completedPassword = $this->getPasswordToHash($plainPassword, $salt);
|
||||
|
||||
foreach ($this->hashAlgoLegacy as $algo) {
|
||||
if ('ssha' === $algo && $this->compareSsha($hashedPassword, $completedPassword)) {
|
||||
if (str_starts_with($hashedPassword, '{SSHA}') && $this->compareSsha($hashedPassword, $plainPassword)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (password_verify($completedPassword, $hashedPassword)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach(hash_algos() as $algo) {
|
||||
if (hash_equals($hashedPassword, hash($algo, $completedPassword))) {
|
||||
return true;
|
||||
}
|
||||
if ($this->isObsoleteAlgo($algo)) {
|
||||
if (hash_equals(hash($algo, $completedPassword), $hashedPassword)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (password_verify($completedPassword, $hashedPassword)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidSQLPasswordException();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user