mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
Security : Use password_verify() (#5660)
This commit is contained in:
parent
8e444c3b32
commit
ec5f6877f5
@ -171,8 +171,7 @@ class API extends Base implements IAuthConnector
|
||||
// expired user
|
||||
return false;
|
||||
}
|
||||
$passwd = crypt($password, $apiSecret);
|
||||
if ($passwd == $apiSecret) {
|
||||
if (password_verify($password, $apiSecret)) {
|
||||
// password ok, return successfully authentication
|
||||
$this->lastAuthProperties['username'] = (string)$userObject->name;
|
||||
return true;
|
||||
|
||||
@ -158,8 +158,7 @@ class Local extends Base implements IAuthConnector
|
||||
// expired user
|
||||
return false;
|
||||
}
|
||||
$passwd = crypt($password, (string)$userObject->password);
|
||||
if ($passwd == (string)$userObject->password) {
|
||||
if (password_verify($password, (string)$userObject->password)) {
|
||||
// password ok, return successfully authentication
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -413,8 +413,7 @@ class Voucher extends Base implements IAuthConnector
|
||||
$result = $stmt->execute();
|
||||
$row = $result->fetchArray();
|
||||
if ($row != null) {
|
||||
$passwd = crypt($password, (string)$row['password']);
|
||||
if ($passwd == (string)$row['password']) {
|
||||
if (password_verify($password, (string)$row['password'])) {
|
||||
// correct password, check validity
|
||||
if ($row['starttime'] == null) {
|
||||
// initial login, set starttime for counter
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user