]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed encryption session namespace to avoid problems
authorFlorin Peter <github@florin-peter.de>
Tue, 28 May 2013 15:04:35 +0000 (17:04 +0200)
committerFlorin Peter <github@florin-peter.de>
Tue, 28 May 2013 15:04:35 +0000 (17:04 +0200)
apps/files_encryption/hooks/hooks.php
apps/files_encryption/lib/proxy.php
apps/files_encryption/lib/stream.php
apps/files_encryption/lib/util.php
apps/files_encryption/tests/crypt.php

index 9af1f2c6459e99bb4921a19dba78afb587188735..0ef796dbaef2b5451bf8e32d8c8cb6dff4a1dd3f 100644 (file)
@@ -57,7 +57,7 @@ class Hooks {
                \r
                $privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, $params['password'] );\r
 \r
-               $session = new Session( $view );\r
+               $session = new \OCA\Encryption\Session( $view );\r
                \r
                $session->setPrivateKey( $privateKey, $params['uid'] );\r
                \r
@@ -151,7 +151,7 @@ class Hooks {
 \r
                                $view = new \OC_FilesystemView('/');\r
 \r
-                               $session = new Session($view);\r
+                               $session = new \OCA\Encryption\Session($view);\r
 \r
                                // Get existing decrypted private key\r
                                $privateKey = $session->getPrivateKey();\r
@@ -266,7 +266,7 @@ class Hooks {
                if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {\r
 \r
                        $view = new \OC_FilesystemView('/');\r
-                       $session = new Session($view);\r
+                       $session = new \OCA\Encryption\Session($view);\r
                        $userId = \OCP\User::getUser();\r
                        $util = new Util($view, $userId);\r
                        $path = $util->fileIdToPath($params['itemSource']);\r
@@ -438,7 +438,7 @@ class Hooks {
         \OC_FileProxy::$enabled = false;\r
 \r
         $view = new \OC_FilesystemView('/');\r
-        $session = new Session($view);\r
+        $session = new \OCA\Encryption\Session($view);\r
         $userId = \OCP\User::getUser();\r
         $util = new Util( $view, $userId );\r
 \r
index 0f7eb84dc1b76174736feba860ef65c9c7709d00..e381ecab5c311051f400350986662ed2e60eb5e5 100644 (file)
@@ -111,7 +111,7 @@ class Proxy extends \OC_FileProxy
                                $userId = \OCP\USER::getUser();
                                $view = new \OC_FilesystemView( '/' );
                                $util = new Util( $view, $userId );
-                               $session = new Session( $view );
+                               $session = new \OCA\Encryption\Session( $view );
                                $privateKey = $session->getPrivateKey();
                                $filePath = $util->stripUserFilesPath( $path );
                                // Set the filesize for userland, before encrypting
@@ -197,7 +197,7 @@ class Proxy extends \OC_FileProxy
                \OC_FileProxy::$enabled = false;
 
                // init session
-               $session = new Session( $view );
+               $session = new \OCA\Encryption\Session( $view );
 
                // If data is a catfile
                if (
@@ -439,7 +439,7 @@ class Proxy extends \OC_FileProxy
                \OC_FileProxy::$enabled = false;
 
                $view = new \OC_FilesystemView( '/' );
-               $session = new Session( $view );
+               $session = new \OCA\Encryption\Session( $view );
                $userId = \OCP\User::getUser();
                $util = new Util( $view, $userId );
 
index fa9df02f085095d9100d20f7e4f8160491cb7708..da8c2494139c5134644efe318583a7d5b2bd5983 100644 (file)
@@ -228,7 +228,7 @@ class Stream
                // If a keyfile already exists
                if ( $this->encKeyfile ) {
 
-                       $session = new Session( $this->rootView );
+                       $session = new \OCA\Encryption\Session( $this->rootView );
 
                        $privateKey = $session->getPrivateKey( $this->userId );
 
index 48485cf2e86eb24b783a669de229040a951fbbba..6ffe31c9bb4fc61085f82e8de20a0b8ee9ab0e76 100644 (file)
@@ -1420,7 +1420,7 @@ class Util {
                        if ($item['type'] == 'dir') {
                                $this->addRecoveryKeys($filePath . '/');
                        } else {
-                               $session = new Session(new \OC_FilesystemView('/'));
+                               $session = new \OCA\Encryption\Session(new \OC_FilesystemView('/'));
                                $sharingEnabled = \OCP\Share::isEnabled();
                                $file = substr($filePath, 0, -4);
                                $usersSharing = $this->getSharingUsersArray($sharingEnabled, $file);
index e9f155e2649cc8ede6d0f61b5dde28abfe6addf4..5b0486aad8cc2a91f90761a9a4fdf11da56706f3 100755 (executable)
@@ -270,7 +270,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
                $shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $filename);
 
                // get session
-               $session = new Encryption\Session($this->view);
+               $session = new \OCA\Encryption\Session($this->view);
 
                // get private key
                $privateKey = $session->getPrivateKey($this->userId);
@@ -345,7 +345,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
                $shareKey = Encryption\Keymanager::getShareKey($this->view, $this->userId, $filename);
 
                // get session
-               $session = new Encryption\Session($this->view);
+               $session = new \OCA\Encryption\Session($this->view);
 
                // get private key
                $privateKey = $session->getPrivateKey($this->userId);