Skip to content

Commit

Permalink
Merge pull request #8729 from owncloud/add-phpseclib-master
Browse files Browse the repository at this point in the history
use phpseclib from 3rdparty
  • Loading branch information
DeepDiver1975 committed Jun 3, 2014
2 parents b62cb00 + 17cbfc7 commit d3e830e
Show file tree
Hide file tree
Showing 36 changed files with 10 additions and 31,208 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
18 changes: 7 additions & 11 deletions apps/files_encryption/3rdparty/Crypt_Blowfish/Blowfish.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
* @link http://pear.php.net/package/Crypt_Blowfish
*/


require_once 'PEAR.php';


/**
*
* Example usage:
Expand All @@ -47,7 +45,7 @@
* @version @package_version@
* @access public
*/
class Crypt_Blowfish
class Legacy_Crypt_Blowfish
{
/**
* P-Array contains 18 32-bit subkeys
Expand Down Expand Up @@ -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', '');
Expand Down Expand Up @@ -133,7 +131,7 @@ function init()
*/
function _init()
{
$defaults = new Crypt_Blowfish_DefaultKey();
$defaults = new \Crypt_Blowfish_DefaultKey();
$this->_P = $defaults->P;
$this->_S = $defaults->S;
}
Expand Down Expand Up @@ -192,7 +190,7 @@ function _decipher(&$Xl, &$Xr)
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')) {
Expand Down Expand Up @@ -221,7 +219,7 @@ function encrypt($plainText)
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')) {
Expand Down Expand Up @@ -252,13 +250,13 @@ function decrypt($cipherText)
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')) {
Expand Down Expand Up @@ -313,5 +311,3 @@ function setKey($key)
}

}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @link http://pear.php.net/package/Crypt_Blowfish
*/


/**
* Class containing default key
*
Expand Down Expand Up @@ -323,5 +322,3 @@ function Crypt_Blowfish_DefaultKey()
}

}

?>
2 changes: 1 addition & 1 deletion apps/files_encryption/lib/crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private static function getBlowfish($key = '') {

if ($key) {

return new \Crypt_Blowfish($key);
return new \Legacy_Crypt_Blowfish($key);

} else {

Expand Down
2 changes: 1 addition & 1 deletion apps/files_encryption/tests/crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ function testFopenFile() {
*/
function legacyEncrypt($data, $passwd) {

$bf = new \Crypt_Blowfish($passwd);
$bf = new Legacy_Crypt_Blowfish($passwd);
$crypted = $bf->encrypt($data);

return $crypted;
Expand Down
5 changes: 0 additions & 5 deletions apps/files_external/3rdparty/phpseclib/AUTHORS

This file was deleted.

21 changes: 0 additions & 21 deletions apps/files_external/3rdparty/phpseclib/LICENSE

This file was deleted.

16 changes: 0 additions & 16 deletions apps/files_external/3rdparty/phpseclib/README.md

This file was deleted.

77 changes: 0 additions & 77 deletions apps/files_external/3rdparty/phpseclib/composer.json

This file was deleted.

95 changes: 0 additions & 95 deletions apps/files_external/3rdparty/phpseclib/composer.lock

This file was deleted.

Loading

0 comments on commit d3e830e

Please sign in to comment.