From 70a44621beac44e258b46ff17e1d68d86e18d00d Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 29 Apr 2015 17:18:41 +0200 Subject: check recovery setting for the right user --- apps/encryption/lib/crypto/encryption.php | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'apps/encryption/lib/crypto/encryption.php') 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); @@ -297,28 +297,6 @@ class Encryption implements IEncryptionModule { return true; } - /** - * 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 * -- cgit v1.2.3