From d6c4df7a5d01cd6922d20ad3eeb8500f59bc8095 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 8 May 2018 09:06:19 +0200 Subject: [PATCH] Use password_hash and password_verify --- library/Icinga/Authentication/User/DbUserBackend.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Authentication/User/DbUserBackend.php b/library/Icinga/Authentication/User/DbUserBackend.php index 8cf4f5f40..35a0c3cc6 100644 --- a/library/Icinga/Authentication/User/DbUserBackend.php +++ b/library/Icinga/Authentication/User/DbUserBackend.php @@ -4,7 +4,6 @@ namespace Icinga\Authentication\User; use Exception; -use Icinga\Authentication\PasswordHelper; use Icinga\Data\Inspectable; use Icinga\Data\Inspection; use Icinga\Data\Filter\Filter; @@ -166,7 +165,7 @@ class DbUserBackend extends DbRepository implements UserBackendInterface, Inspec */ protected function persistPassword($value) { - return PasswordHelper::hash($value); + return password_hash($value, PASSWORD_DEFAULT); } /** @@ -213,7 +212,7 @@ class DbUserBackend extends DbRepository implements UserBackendInterface, Inspec public function authenticate(User $user, $password) { try { - return PasswordHelper::verify( + return password_verify( $password, $this->getPasswordHash($user->getUsername()) );