|
|
@ -394,17 +394,20 @@ class KeyManager { |
|
|
public function getFileKey($path, $uid) { |
|
|
public function getFileKey($path, $uid) { |
|
|
$encryptedFileKey = $this->keyStorage->getFileKey($path, $this->fileKeyId, Encryption::ID); |
|
|
$encryptedFileKey = $this->keyStorage->getFileKey($path, $this->fileKeyId, Encryption::ID); |
|
|
|
|
|
|
|
|
|
|
|
if (empty($encryptedFileKey)) { |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($this->util->isMasterKeyEnabled()) { |
|
|
|
|
|
$uid = $this->getMasterKeyId(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (is_null($uid)) { |
|
|
if (is_null($uid)) { |
|
|
$uid = $this->getPublicShareKeyId(); |
|
|
$uid = $this->getPublicShareKeyId(); |
|
|
$shareKey = $this->getShareKey($path, $uid); |
|
|
$shareKey = $this->getShareKey($path, $uid); |
|
|
$privateKey = $this->keyStorage->getSystemUserKey($this->publicShareKeyId . '.privateKey', Encryption::ID); |
|
|
$privateKey = $this->keyStorage->getSystemUserKey($this->publicShareKeyId . '.privateKey', Encryption::ID); |
|
|
$privateKey = $this->crypt->decryptPrivateKey($privateKey); |
|
|
$privateKey = $this->crypt->decryptPrivateKey($privateKey); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
if ($this->util->isMasterKeyEnabled()) { |
|
|
|
|
|
$uid = $this->getMasterKeyId(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$shareKey = $this->getShareKey($path, $uid); |
|
|
$shareKey = $this->getShareKey($path, $uid); |
|
|
$privateKey = $this->session->getPrivateKey(); |
|
|
$privateKey = $this->session->getPrivateKey(); |
|
|
} |
|
|
} |
|
|
|