From d9468e3fff383c61fa7ab1649978b161d7ab83ec Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sun, 7 Dec 2014 06:37:15 -0500 Subject: [PATCH 1/2] Bug #4623 Incomplete PHP OpenSSL support Signed-off-by: Marc Delisle --- .../plugins/auth/AuthenticationCookie.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php index 9f67209da0..c9012486fb 100644 --- a/libraries/plugins/auth/AuthenticationCookie.class.php +++ b/libraries/plugins/auth/AuthenticationCookie.class.php @@ -31,8 +31,13 @@ require './libraries/plugins/auth/swekey/swekey.auth.lib.php'; /** * phpseclib */ -require PHPSECLIB_INC_DIR . '/Crypt/AES.php'; -require PHPSECLIB_INC_DIR . '/Crypt/Random.php'; +if (! function_exists('openssl_encrypt') + || ! function_exists('openssl_decrypt') + || ! function_exists('openssl_random_pseudo_bytes') + || PHP_VERSION_ID < 50304) { + require PHPSECLIB_INC_DIR . '/Crypt/AES.php'; + require PHPSECLIB_INC_DIR . '/Crypt/Random.php'; +} /** * Handles the cookie authentication method @@ -728,7 +733,11 @@ class AuthenticationCookie extends AuthenticationPlugin private function _getSessionEncryptionSecret() { if (empty($_SESSION['encryption_key'])) { - $_SESSION['encryption_key'] = crypt_random_string(256); + if ($this->_useOpenSSL()) { + $_SESSION['encryption_key'] = openssl_random_pseudo_bytes(256); + } else { + $_SESSION['encryption_key'] = crypt_random_string(256); + } } return $_SESSION['encryption_key']; } @@ -743,6 +752,7 @@ class AuthenticationCookie extends AuthenticationPlugin return ( function_exists('openssl_encrypt') && function_exists('openssl_decrypt') + && function_exists('openssl_random_pseudo_bytes') && PHP_VERSION_ID >= 50304 ); } From a8a158e0f0045554b65bacb3e63ff301b65a2d11 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 7 Dec 2014 06:40:23 -0500 Subject: [PATCH 2/2] ChangeLog entry Signed-off-by: Marc Delisle --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index f82362c3d2..3cda003b91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ phpMyAdmin - ChangeLog - bug #4618 Page scrolls while GIS visualization is zoomed in/out with mousewheel - bug #4613 HHVM: method 'ob_gzhandler' not found - bug #4593 Manual "SELECT" doesn't change active table +- bug #4623 Incomplete PHP OpenSSL support 4.3.0.0 (2014-12-05) + rfe #1502 Smart sorting for int keys