From: Marcel Werk Date: Wed, 1 Nov 2023 14:14:11 +0000 (+0100) Subject: Apply suggestions from code review X-Git-Tag: 6.0.3_dev_1~49^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b040f124dd5f7b5f3aed0388030079ac905fff19;p=GitHub%2FWoltLab%2FWCF.git Apply suggestions from code review Co-authored-by: Tim Düsterhus --- 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]); }