diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-04-29 17:18:41 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2015-04-30 11:38:53 +0200 |
commit | 70a44621beac44e258b46ff17e1d68d86e18d00d (patch) | |
tree | 17eeb5660f7e74e683cff60cf6b86f8b13ad7446 /apps/encryption/lib/crypto/encryption.php | |
parent | d308ec4f0ea54e8cb0c99228a480da8cb7cf30a8 (diff) | |
download | nextcloud-server-70a44621beac44e258b46ff17e1d68d86e18d00d.tar.gz nextcloud-server-70a44621beac44e258b46ff17e1d68d86e18d00d.zip |
check recovery setting for the right user
Diffstat (limited to 'apps/encryption/lib/crypto/encryption.php')
-rw-r--r-- | apps/encryption/lib/crypto/encryption.php | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php index 4e181b0712a..c622836b335 100644 --- a/apps/encryption/lib/crypto/encryption.php +++ b/apps/encryption/lib/crypto/encryption.php @@ -174,7 +174,7 @@ class Encryption implements IEncryptionModule { $publicKeys[$uid] = $this->keyManager->getPublicKey($uid); } - $publicKeys = $this->keyManager->addSystemKeys($this->accessList, $publicKeys); + $publicKeys = $this->keyManager->addSystemKeys($this->accessList, $publicKeys, $this->user); $encryptedKeyfiles = $this->crypt->multiKeyEncrypt($this->fileKey, $publicKeys); $this->keyManager->setAllFileKeys($this->path, $encryptedKeyfiles); @@ -271,7 +271,7 @@ class Encryption implements IEncryptionModule { */ public function update($path, $uid, array $accessList) { $fileKey = $this->keyManager->getFileKey($path, $uid); - + if (!empty($fileKey)) { $publicKeys = array(); @@ -279,7 +279,7 @@ class Encryption implements IEncryptionModule { $publicKeys[$user] = $this->keyManager->getPublicKey($user); } - $publicKeys = $this->keyManager->addSystemKeys($accessList, $publicKeys); + $publicKeys = $this->keyManager->addSystemKeys($accessList, $publicKeys, $uid); $encryptedFileKey = $this->crypt->multiKeyEncrypt($fileKey, $publicKeys); @@ -298,28 +298,6 @@ class Encryption implements IEncryptionModule { } /** - * add system keys such as the public share key and the recovery key - * - * @param array $accessList - * @param array $publicKeys - * @return array - */ - public function addSystemKeys(array $accessList, array $publicKeys) { - if (!empty($accessList['public'])) { - $publicKeys[$this->keyManager->getPublicShareKeyId()] = $this->keyManager->getPublicShareKey(); - } - - if ($this->keyManager->recoveryKeyExists() && - $this->util->isRecoveryEnabledForUser()) { - - $publicKeys[$this->keyManager->getRecoveryKeyId()] = $this->keyManager->getRecoveryKey(); - } - - return $publicKeys; - } - - - /** * should the file be encrypted or not * * @param string $path |