diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-26 22:24:20 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-03 12:18:30 +0200 |
commit | 17cbfc714a77cfe8b89199fcf780319bd87a43a0 (patch) | |
tree | 045802785e01a48f7e4ae75cd37af59488cba9b7 /apps/files_encryption | |
parent | 929882a32a020b6c05605f416fa55024b9a60d33 (diff) | |
download | nextcloud-server-17cbfc714a77cfe8b89199fcf780319bd87a43a0.tar.gz nextcloud-server-17cbfc714a77cfe8b89199fcf780319bd87a43a0.zip |
use phpseclib from 3rdparty
rename class Crypt_Blowfish to Legacy_Crypt_Blowfish
Diffstat (limited to 'apps/files_encryption')
4 files changed, 9 insertions, 16 deletions
diff --git a/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php b/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php index 4ccacb963e3..2f04b9fcb57 100644 --- a/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php +++ b/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php @@ -25,10 +25,8 @@ * @link http://pear.php.net/package/Crypt_Blowfish */ - require_once 'PEAR.php'; - /** * * Example usage: @@ -47,7 +45,7 @@ require_once 'PEAR.php'; * @version @package_version@ * @access public */ -class Crypt_Blowfish +class Legacy_Crypt_Blowfish { /** * P-Array contains 18 32-bit subkeys @@ -91,7 +89,7 @@ class Crypt_Blowfish * @param string $key * @access public */ - function Crypt_Blowfish($key) + function Legacy_Crypt_Blowfish($key) { if (extension_loaded('mcrypt')) { $this->_td = mcrypt_module_open(MCRYPT_BLOWFISH, '', 'ecb', ''); @@ -133,7 +131,7 @@ class Crypt_Blowfish */ function _init() { - $defaults = new Crypt_Blowfish_DefaultKey(); + $defaults = new \Crypt_Blowfish_DefaultKey(); $this->_P = $defaults->P; $this->_S = $defaults->S; } @@ -192,7 +190,7 @@ class Crypt_Blowfish function encrypt($plainText) { if (!is_string($plainText)) { - PEAR::raiseError('Plain text must be a string', 0, PEAR_ERROR_DIE); + \PEAR::raiseError('Plain text must be a string', 0, PEAR_ERROR_DIE); } if (extension_loaded('mcrypt')) { @@ -221,7 +219,7 @@ class Crypt_Blowfish function decrypt($cipherText) { if (!is_string($cipherText)) { - PEAR::raiseError('Cipher text must be a string', 1, PEAR_ERROR_DIE); + \PEAR::raiseError('Cipher text must be a string', 1, PEAR_ERROR_DIE); } if (extension_loaded('mcrypt')) { @@ -252,13 +250,13 @@ class Crypt_Blowfish function setKey($key) { if (!is_string($key)) { - PEAR::raiseError('Key must be a string', 2, PEAR_ERROR_DIE); + \PEAR::raiseError('Key must be a string', 2, PEAR_ERROR_DIE); } $len = strlen($key); if ($len > 56 || $len == 0) { - PEAR::raiseError('Key must be less than 56 characters and non-zero. Supplied key length: ' . $len, 3, PEAR_ERROR_DIE); + \PEAR::raiseError('Key must be less than 56 characters and non-zero. Supplied key length: ' . $len, 3, PEAR_ERROR_DIE); } if (extension_loaded('mcrypt')) { @@ -313,5 +311,3 @@ class Crypt_Blowfish } } - -?> diff --git a/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish/DefaultKey.php b/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish/DefaultKey.php index 2ff8ac788a6..ce069498a9d 100644 --- a/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish/DefaultKey.php +++ b/apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish/DefaultKey.php @@ -25,7 +25,6 @@ * @link http://pear.php.net/package/Crypt_Blowfish */ - /** * Class containing default key * @@ -323,5 +322,3 @@ class Crypt_Blowfish_DefaultKey } } - -?> diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index ec7b3bc92e4..694791810c9 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -532,7 +532,7 @@ class Crypt { if ($key) {
- return new \Crypt_Blowfish($key);
+ return new \Legacy_Crypt_Blowfish($key);
} else {
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index b22cd214eaa..3674381b6d1 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -667,7 +667,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { */ function legacyEncrypt($data, $passwd) { - $bf = new \Crypt_Blowfish($passwd); + $bf = new Legacy_Crypt_Blowfish($passwd); $crypted = $bf->encrypt($data); return $crypted; |