Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow to use system phpseclib
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jul 8, 2014
1 parent 4ad6e8c commit 7089858
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/vendors.rst
Expand Up @@ -31,4 +31,5 @@ libraries/php-gettext
php-gettext library
libraries/tcpdf
tcpdf library, stripped down of not needed files

libraries/phpseclib
portions of phpseclib library
4 changes: 2 additions & 2 deletions libraries/plugins/auth/AuthenticationCookie.class.php
Expand Up @@ -718,7 +718,7 @@ public function blowfishEncrypt($data, $secret)
* if/then/else logic, however the include_once
* call is costly
*/
include_once "./libraries/phpseclib/Crypt/AES.php";
include_once PHPSECLIB_INC_DIR . '/Crypt/AES.php';
$cipher = new Crypt_AES(CRYPT_AES_MODE_ECB);
$cipher->setKey($secret);
return base64_encode($cipher->encrypt($data));
Expand Down Expand Up @@ -750,7 +750,7 @@ public function blowfishDecrypt($encdata, $secret)
$this->_blowfish_iv = base64_decode($_COOKIE['pma_mcrypt_iv'], true);
}
if (! function_exists('mcrypt_encrypt')) {
include_once "./libraries/phpseclib/Crypt/AES.php";
include_once PHPSECLIB_INC_DIR . '/Crypt/AES.php';
$cipher = new Crypt_AES(CRYPT_AES_MODE_ECB);
$cipher->setKey($secret);
return $cipher->decrypt(base64_decode($encdata));
Expand Down
5 changes: 5 additions & 0 deletions libraries/vendor_config.php
Expand Up @@ -74,6 +74,11 @@
*/
define('TCPDF_INC', './libraries/tcpdf/tcpdf.php');

/**
* Path to the phpseclib. Useful when you want to use system phpseclib.
*/
define('PHPSECLIB_INC_DIR', './libraries/phpseclib/');

/**
* Avoid referring to nonexistent files (causes warnings when open_basedir
* is used)
Expand Down

0 comments on commit 7089858

Please sign in to comment.