summaryrefslogtreecommitdiffstats
path: root/phpMyAdmin-phpseclib.patch
blob: 87f254abbcfe3f836cb1d10f484b69a2831d98ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From c6e76422c41e1c573c0c0163376a61d4556083b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <michal@cihar.com>
Date: Thu, 12 Jun 2014 10:06:20 +0200
Subject: [PATCH] Allow to use system phpseclib
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Michal Čihař <michal@cihar.com>
---
 doc/vendors.rst                                       | 3 ++-
 libraries/plugins/auth/AuthenticationCookie.class.php | 4 ++--
 libraries/vendor_config.php                           | 5 +++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php
index 9683b78..88bd852 100644
--- a/libraries/plugins/auth/AuthenticationCookie.class.php
+++ b/libraries/plugins/auth/AuthenticationCookie.class.php
@@ -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));
@@ -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));
diff --git a/libraries/vendor_config.php b/libraries/vendor_config.php
index ea72b64..0ba36b0 100644
--- a/libraries/vendor_config.php
+++ b/libraries/vendor_config.php
@@ -75,6 +75,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)
  */
-- 
1.9.3