Fixed psm_password_decrypt

BUG: HTTP2 Authentification
Fixes #706.
pull/851/head
Petr Suchy 2020-02-04 15:44:11 +01:00 committed by GitHub
parent 676e80d42f
commit 71c4114747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 9 deletions

View File

@ -893,15 +893,12 @@ namespace {
$cipher = "AES-256-CBC"; $cipher = "AES-256-CBC";
$ivlen = openssl_cipher_iv_length($cipher); $ivlen = openssl_cipher_iv_length($cipher);
$iv = substr($data, 0, $ivlen); $iv = substr($data, 0, $ivlen);
$decrypted = rtrim( $decrypted = openssl_decrypt(
openssl_decrypt( substr($data, $ivlen),
base64_encode(substr($data, $ivlen)), $cipher,
$cipher, hash('sha256', $key, true),
hash('sha256', $key, true), OPENSSL_RAW_DATA,
OPENSSL_ZERO_PADDING, $iv
$iv
),
"\0"
); );
return $decrypted; return $decrypted;