From a450935e53a130319b84ce180a3456009e2c04b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 29 Nov 2017 09:13:23 +0100 Subject: [PATCH] Compatibility with phpseclib 2.0.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently upgrade from 2.0.7 to 2.0.8 changed API in several ways. See https://github.com/phpseclib/phpseclib/issues/1218 Fixes #13846 Signed-off-by: Michal Čihař --- ChangeLog | 1 + composer.json | 2 +- libraries/plugins/auth/AuthenticationCookie.php | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6b09d33f2..ea1982b7d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - issue #13821 Lock page when changes are done in the SQL editor - issue #13842 Prefer iconv for encoding conversions - issue #13737 Fixed changing password on MariaDB cluster +- issue #13846 Compatibility with phpseclib 2.0.8 4.7.5 (2017-10-23) - issue #13615 Avoid problems with browsing unknown query types diff --git a/composer.json b/composer.json index d7d70ce941..5e326aeac2 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "phpmyadmin/motranslator": "^3.0", "phpmyadmin/shapefile": "^2.0", "tecnickcom/tcpdf": "^6.2", - "phpseclib/phpseclib": "^2.0", + "phpseclib/phpseclib": "^2.0.8", "google/recaptcha": "^1.1" }, "suggest": { diff --git a/libraries/plugins/auth/AuthenticationCookie.php b/libraries/plugins/auth/AuthenticationCookie.php index 6d1c7bd264..f569592283 100644 --- a/libraries/plugins/auth/AuthenticationCookie.php +++ b/libraries/plugins/auth/AuthenticationCookie.php @@ -762,7 +762,7 @@ class AuthenticationCookie extends AuthenticationPlugin $iv ); } else { - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); + $cipher = new Crypt\AES('cbc'); $cipher->setIV($iv); $cipher->setKey($aes_secret); $result = base64_encode($cipher->encrypt($data)); @@ -814,7 +814,7 @@ class AuthenticationCookie extends AuthenticationPlugin base64_decode($data['iv']) ); } else { - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); + $cipher = new Crypt\AES('cbc'); $cipher->setIV(base64_decode($data['iv'])); $cipher->setKey($aes_secret); $result = $cipher->decrypt(base64_decode($data['payload'])); @@ -833,8 +833,8 @@ class AuthenticationCookie extends AuthenticationPlugin if ($this->_use_openssl) { return openssl_cipher_iv_length('AES-128-CBC'); } - $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); - return $cipher->block_size; + $cipher = new Crypt\AES('cbc'); + return $cipher->getBlockLengthInBytes(); } /**