From b040f124dd5f7b5f3aed0388030079ac905fff19 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 1 Nov 2023 15:14:11 +0100 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- .../user/authentication/password/algorithm/Pbkdf2.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/authentication/password/algorithm/Pbkdf2.class.php b/wcfsetup/install/files/lib/system/user/authentication/password/algorithm/Pbkdf2.class.php index 6f1fdbfe5c..3784236d2e 100644 --- a/wcfsetup/install/files/lib/system/user/authentication/password/algorithm/Pbkdf2.class.php +++ b/wcfsetup/install/files/lib/system/user/authentication/password/algorithm/Pbkdf2.class.php @@ -29,7 +29,7 @@ final class Pbkdf2 implements IPasswordAlgorithm } [$hash, $salt, $algo, $iterations, $length] = $parts; - return \hash_equals($hash, \bin2hex(\hash_pbkdf2($algo, $password, $salt, $iterations, $length, true))); + return \hash_equals($hash, Hex::encode(\hash_pbkdf2($algo, $password, $salt, $iterations, $length, true))); } /** @@ -43,7 +43,7 @@ final class Pbkdf2 implements IPasswordAlgorithm $algo = 'sha256'; $iterations = 600000; $length = 32; - $hash = \bin2hex(\hash_pbkdf2($algo, $password, $salt, $iterations, $length, true)); + $hash = Hex::encode(\hash_pbkdf2($algo, $password, $salt, $iterations, $length, true)); return \implode(':', [$hash, $salt, $algo, $iterations, $length]); } -- 2.20.1