summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/keymanager.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-20 18:10:56 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-20 18:10:56 +0100
commitc5cb4206f53d2a87f3d8e17fd8447dae4dc4a50c (patch)
treec015d92fb10162477385c0e4f726d7d1026eb910 /apps/files_encryption/lib/keymanager.php
parent30b8f4ec8e3dbf8e2d5d3627e0447bc20da50335 (diff)
downloadnextcloud-server-c5cb4206f53d2a87f3d8e17fd8447dae4dc4a50c.tar.gz
nextcloud-server-c5cb4206f53d2a87f3d8e17fd8447dae4dc4a50c.zip
[wip] make encryption work with public gallery sharing
Diffstat (limited to 'apps/files_encryption/lib/keymanager.php')
-rwxr-xr-xapps/files_encryption/lib/keymanager.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index 6dadd12a62e..8d3e72b422b 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -172,16 +172,14 @@ class Keymanager {
/**
* @brief retrieve keyfile for an encrypted file
* @param \OC_FilesystemView $view
- * @param $userId
+ * @param \OCA\Encryption\Util $util
* @param $filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption
* of the keyfile must be performed by client code
*/
- public static function getFileKey(\OC_FilesystemView $view, $userId, $filePath) {
-
- $util = new Util($view, \OCP\User::getUser());
+ public static function getFileKey(\OC_FilesystemView $view, $util, $filePath) {
list($owner, $filename) = $util->getUidAndFilename($filePath);
$filename = Helper::stripPartialFileExtension($filename);
@@ -364,21 +362,19 @@ class Keymanager {
* @brief retrieve shareKey for an encrypted file
* @param \OC_FilesystemView $view
* @param string $userId
+ * @param \OCA\Encryption\Util $util
* @param string $filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The sharekey returned is encrypted. Decryption
* of the keyfile must be performed by client code
*/
- public static function getShareKey(\OC_FilesystemView $view, $userId, $filePath) {
+ public static function getShareKey(\OC_FilesystemView $view, $userId, $util, $filePath) {
// try reusing key file if part file
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- //here we need the currently logged in user, while userId can be a different user
- $util = new Util($view, \OCP\User::getUser());
-
list($owner, $filename) = $util->getUidAndFilename($filePath);
$filename = Helper::stripPartialFileExtension($filename);
// in case of system wide mount points the keys are stored directly in the data directory