aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-27 12:21:39 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-27 12:21:39 +0200
commit09765ea27cb5a53cbd3595aa71a1f5b9941fde89 (patch)
tree6a5f5f5be39f2ebbd2e7aad35080a4c1f2eda40b /apps
parent189d251c6a6abfc6a1d1482c5487177f9842ceb6 (diff)
downloadnextcloud-server-09765ea27cb5a53cbd3595aa71a1f5b9941fde89.tar.gz
nextcloud-server-09765ea27cb5a53cbd3595aa71a1f5b9941fde89.zip
make legacyDecrypt() private als always call legacyBlockDecrypt() from other classes
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/hooks/hooks.php2
-rwxr-xr-xapps/files_encryption/lib/crypt.php2
-rw-r--r--apps/files_encryption/lib/proxy.php2
-rwxr-xr-xapps/files_encryption/tests/crypt.php6
4 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 07072fb8c44..9af1f2c6459 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -76,7 +76,7 @@ class Hooks {
&& $encLegacyKey = $userView->file_get_contents( 'encryption.key' )
) {
- $plainLegacyKey = Crypt::legacyDecrypt( $encLegacyKey, $params['password'] );
+ $plainLegacyKey = Crypt::legacyBlockDecrypt( $encLegacyKey, $params['password'] );
$session->setLegacyKey( $plainLegacyKey );
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 009a648016b..9345712a455 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -607,7 +607,7 @@ class Crypt
*
* This function decrypts an content
*/
- public static function legacyDecrypt( $content, $passphrase = '' ) {
+ private static function legacyDecrypt( $content, $passphrase = '' ) {
$bf = self::getBlowfish( $passphrase );
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index eaaeae9b619..d9520810bf4 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -223,7 +223,7 @@ class Proxy extends \OC_FileProxy
&& isset( $_SESSION['legacyenckey'] )
&& Crypt::isEncryptedMeta( $path )
) {
- $plainData = Crypt::legacyDecrypt( $data, $session->getLegacyKey() );
+ $plainData = Crypt::legacyBlockDecrypt( $data, $session->getLegacyKey() );
}
\OC_FileProxy::$enabled = $proxyStatus;
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 621941c52a1..dedc190bb7f 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -528,7 +528,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase
function testLegacyDecryptShort($crypted)
{
- $decrypted = Encryption\Crypt::legacyDecrypt($crypted, $this->pass);
+ $decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
$this->assertEquals($this->dataShort, $decrypted);
@@ -558,7 +558,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase
function testLegacyDecryptLong($crypted)
{
- $decrypted = Encryption\Crypt::legacyDecrypt($crypted, $this->pass);
+ $decrypted = Encryption\Crypt::legacyBlockDecrypt($crypted, $this->pass);
$this->assertEquals($this->dataLong, $decrypted);
@@ -576,7 +576,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase
$encKey = Encryption\Crypt::legacyCreateKey($this->pass);
// Decrypt key
- $key = Encryption\Crypt::legacyDecrypt($encKey, $this->pass);
+ $key = Encryption\Crypt::legacyBlockDecrypt($encKey, $this->pass);
$this->assertTrue(is_numeric($key));