diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index ed254fd8d8..16e9f9177d 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -52,16 +52,11 @@ class Hooks { if(Helper::setupUser($util, $params['password']) === false) { return false; } - - \OC_FileProxy::$enabled = false; - + $encryptedKey = Keymanager::getPrivateKey( $view, $params['uid'] ); - \OC_FileProxy::$enabled = true; - - //$privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, $params['password'] ); - $privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, "helloworld" ); - + $privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, $params['password'] ); + $session = new Session( $view ); $session->setPrivateKey( $privateKey, $params['uid'] ); @@ -86,13 +81,9 @@ class Hooks { $session->setLegacyKey( $plainLegacyKey ); } - - \OC_FileProxy::$enabled = false; - + $publicKey = Keymanager::getPublicKey( $view, $params['uid'] ); - \OC_FileProxy::$enabled = false; - // Encrypt existing user files: // This serves to upgrade old versions of the encryption // app (see appinfo/spec.txt)