summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-13 10:34:48 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-13 10:34:48 +0100
commite0aa6e01ab14191f42b2e79d32a9e0cc0203f975 (patch)
treeb04551d57ab6589d12063e14238b61fe032a4a86 /apps/encryption/lib
parenta5e46226eff081ca869ac2a0a7b80086c863a384 (diff)
parent46f6c289cac2ad20f9b57e1aff2894a38221a917 (diff)
downloadnextcloud-server-e0aa6e01ab14191f42b2e79d32a9e0cc0203f975.tar.gz
nextcloud-server-e0aa6e01ab14191f42b2e79d32a9e0cc0203f975.zip
Merge pull request #21612 from owncloud/fix_21598
fix public link sharing if the master key is enabled
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/keymanager.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php
index eede8b969d6..b6365cf2cce 100644
--- a/apps/encryption/lib/keymanager.php
+++ b/apps/encryption/lib/keymanager.php
@@ -388,16 +388,17 @@ class KeyManager {
public function getFileKey($path, $uid) {
$encryptedFileKey = $this->keyStorage->getFileKey($path, $this->fileKeyId, Encryption::ID);
- if ($this->util->isMasterKeyEnabled()) {
- $uid = $this->getMasterKeyId();
- }
-
if (is_null($uid)) {
$uid = $this->getPublicShareKeyId();
$shareKey = $this->getShareKey($path, $uid);
$privateKey = $this->keyStorage->getSystemUserKey($this->publicShareKeyId . '.privateKey', Encryption::ID);
$privateKey = $this->crypt->decryptPrivateKey($privateKey);
} else {
+
+ if ($this->util->isMasterKeyEnabled()) {
+ $uid = $this->getMasterKeyId();
+ }
+
$shareKey = $this->getShareKey($path, $uid);
$privateKey = $this->session->getPrivateKey();
}