]> source.dussan.org Git - nextcloud-server.git/commitdiff
make legacyDecrypt() private als always call legacyBlockDecrypt() from other classes
authorBjörn Schießle <schiessle@owncloud.com>
Mon, 27 May 2013 10:21:39 +0000 (12:21 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Mon, 27 May 2013 15:35:28 +0000 (17:35 +0200)
apps/files_encryption/hooks/hooks.php
apps/files_encryption/lib/crypt.php
apps/files_encryption/lib/proxy.php
apps/files_encryption/tests/crypt.php

index 07072fb8c44b5d18b536a39f9bf392ef5638821c..9af1f2c6459e99bb4921a19dba78afb587188735 100644 (file)
@@ -76,7 +76,7 @@ class Hooks {
                                && $encLegacyKey = $userView->file_get_contents( 'encryption.key' )\r
                        ) {\r
                        \r
-                               $plainLegacyKey = Crypt::legacyDecrypt( $encLegacyKey, $params['password'] );\r
+                               $plainLegacyKey = Crypt::legacyBlockDecrypt( $encLegacyKey, $params['password'] );\r
                                \r
                                $session->setLegacyKey( $plainLegacyKey );\r
                        \r
index 009a648016bb636383e4f726465370e5766fc04b..9345712a455f7c433d872e387c2bf7afd1a75592 100755 (executable)
@@ -607,7 +607,7 @@ class Crypt
         *\r
         * This function decrypts an content\r
         */\r
-       public static function legacyDecrypt( $content, $passphrase = '' ) {\r
+       private static function legacyDecrypt( $content, $passphrase = '' ) {\r
 \r
                $bf = self::getBlowfish( $passphrase );\r
 \r
index eaaeae9b61951bccf39895bfaa7e64ba743b805b..d9520810bf4a891eeb45751379747cebb9cae29d 100644 (file)
@@ -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;
index 74b4252a1d46f0bcbcfb5b863df66e9427cfbad9..e9f155e2649cc8ede6d0f61b5dde28abfe6addf4 100755 (executable)
@@ -515,7 +515,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);
 
@@ -543,7 +543,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);
 
@@ -560,7 +560,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));