From 1a09e4ff3cb789d82d6ac68e2b85bafc63afc5ef Mon Sep 17 00:00:00 2001 From: Bert Van de Poel Date: Sat, 24 Apr 2021 03:48:49 +0200 Subject: [PATCH] Modernize sha512 hash code: replace openssl_digest with the generic hash function, remove check no longer necessary in minimum version --- lib/functions.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index 69fadd5..70e5d73 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2312,12 +2312,7 @@ function pla_password_hash($password_clear,$enc_type) { break; case 'sha512': - if (function_exists('openssl_digest') && function_exists('base64_encode')) { - $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'); - } + $new_value = sprintf('{SHA512}%s', base64_encode(hash('sha512', $password_clear, true))); break;