*fix - psm_password_decrypt function - BUG: HTTP2 Authentification Bug #706 - see https://github.com/phpservermon/phpservermon/issues/706

This commit is contained in:
Ing. Petr Suchy 2020-01-27 14:20:25 +01:00
parent 676e80d42f
commit 0a8b4a4e45
1 changed files with 6 additions and 9 deletions

View File

@ -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;