LSaddon::accesslog: fix hashing SSHA512 password (in hashPasswordForLogs())

This commit is contained in:
Benjamin Renard 2023-03-28 12:28:45 +02:00
parent 48e5d45d32
commit 3bbf770e33
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -353,7 +353,7 @@ function hashPasswordForLogs($password) {
if(defined('MHASH_SHA512') && function_exists('mhash') && function_exists('mhash_keygen_s2k')) {
mt_srand( (double) microtime() * 1000000 );
$salt = mhash_keygen_s2k(MHASH_SHA512, $password, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 );
return "{SSHA512}".base64_encode(mhash($mhash_type, $password.$salt).$salt);
return "{SSHA512}".base64_encode(mhash(MHASH_SHA512, $password.$salt).$salt);
}
return '[not logged]';
}