diff --git a/ChangeLog b/ChangeLog index 3120532dbf..2d8167ec15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ phpMyAdmin - ChangeLog - issue #11816 Fixed operation with lower_case_table_names=2 - issue #12813 Fixed stored procedure execution - issue #12826 Honor user configured connection collation +- issue #12293 Correctly report OpenSSL errors from cookie encryption 4.6.5.2 (2016-12-05) - issue #12765 Fixed SQL export with newlines diff --git a/libraries/plugins/auth/AuthenticationCookie.php b/libraries/plugins/auth/AuthenticationCookie.php index 5af5b782cc..58fe2e959f 100644 --- a/libraries/plugins/auth/AuthenticationCookie.php +++ b/libraries/plugins/auth/AuthenticationCookie.php @@ -717,6 +717,18 @@ class AuthenticationCookie extends AuthenticationPlugin ); } + /** + * Reports any SSL errors + * + * @return void + */ + public function reportSSLErrors() + { + while (($ssl_err = openssl_error_string()) !== false) { + trigger_error('OpenSSL error: ' . $ssl_err, E_USER_ERROR); + } + } + /** * Encryption using openssl's AES or phpseclib's AES * (phpseclib uses mcrypt when it is available) @@ -739,6 +751,7 @@ class AuthenticationCookie extends AuthenticationPlugin 0, $iv ); + $this->reportSSLErrors(); } else { $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); $cipher->setIV($iv); @@ -783,13 +796,15 @@ class AuthenticationCookie extends AuthenticationPlugin } if ($this->_use_openssl) { - return openssl_decrypt( + $result = openssl_decrypt( $data['payload'], 'AES-128-CBC', $secret, 0, base64_decode($data['iv']) ); + $this->reportSSLErrors(); + return $result; } else { $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); $cipher->setIV(base64_decode($data['iv']));