aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-06-03 12:19:04 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-03 12:19:04 +0200
commitd3e830e938fe85da2fd6d9912c26677034d952f7 (patch)
tree0bcf83d2a867586d3f993f5c5dd097b27e00e6c6 /apps/files_encryption
parentb62cb007715e649d9656c32bfe4b42599fd96983 (diff)
parent17cbfc714a77cfe8b89199fcf780319bd87a43a0 (diff)
downloadnextcloud-server-d3e830e938fe85da2fd6d9912c26677034d952f7.tar.gz
nextcloud-server-d3e830e938fe85da2fd6d9912c26677034d952f7.zip
Merge pull request #8729 from owncloud/add-phpseclib-master
use phpseclib from 3rdparty
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php18
-rw-r--r--apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish/DefaultKey.php3
-rwxr-xr-xapps/files_encryption/lib/crypt.php2
-rwxr-xr-xapps/files_encryption/tests/crypt.php2
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;