From 5abee68ee835c0b46c8e533635afb53c9b7a3be4 Mon Sep 17 00:00:00 2001 From: "Ing. Petr Suchy" Date: Mon, 27 Jan 2020 14:20:25 +0100 Subject: [PATCH] *fix - psm_password_decrypt function - BUG: HTTP2 Authentification Bug #706 - see https://github.com/phpservermon/phpservermon/issues/706 --- src/includes/functions.inc.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 783aa795..85d3cb63 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -893,15 +893,12 @@ namespace { $cipher = "AES-256-CBC"; $ivlen = openssl_cipher_iv_length($cipher); $iv = substr($data, 0, $ivlen); - $decrypted = rtrim( - openssl_decrypt( - base64_encode(substr($data, $ivlen)), - $cipher, - hash('sha256', $key, true), - OPENSSL_ZERO_PADDING, - $iv - ), - "\0" + $decrypted = openssl_decrypt( + substr($data, $ivlen), + $cipher, + hash('sha256', $key, true), + OPENSSL_RAW_DATA, + $iv ); return $decrypted;