Modernize sha512 hash code: replace openssl_digest with the generic hash function, remove check no longer necessary in minimum version

This commit is contained in:
Bert Van de Poel 2021-04-24 03:48:49 +02:00 committed by Deon George
parent bc1691f5d2
commit 1a09e4ff3c

View File

@ -2312,12 +2312,7 @@ function pla_password_hash($password_clear,$enc_type) {
break; break;
case 'sha512': case 'sha512':
if (function_exists('openssl_digest') && function_exists('base64_encode')) { $new_value = sprintf('{SHA512}%s', base64_encode(hash('sha512', $password_clear, true)));
$new_value = sprintf('{SHA512}%s', base64_encode(openssl_digest($password_clear, 'sha512', true)));
} else {
error(_('Your PHP install doest not have the openssl_digest() or base64_encode() function. Cannot do SHA512 hashes. '),'error','index.php');
}
break; break;