[Pkg-owncloud-commits] [owncloud] 63/122: Merge pull request #15938 from owncloud/enc_update_recovery_share_key

David Prévot taffit at moszumanska.debian.org
Sat May 9 00:00:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 2ce01ee0bfd61a6b947154214908ccf9c4fc877f
Merge: a7deba7 31b6574
Author: Björn Schießle <bjoern at schiessle.org>
Date:   Tue May 5 10:48:09 2015 +0200

    Merge pull request #15938 from owncloud/enc_update_recovery_share_key
    
    [encryption] check recovery key setting for the correct user

 apps/encryption/lib/crypto/encryption.php      | 28 ++----------
 apps/encryption/lib/keymanager.php             |  5 ++-
 apps/encryption/lib/recovery.php               | 28 +++++++-----
 apps/encryption/lib/util.php                   |  7 ++-
 apps/encryption/settings/settings-personal.php |  2 +-
 apps/encryption/tests/lib/KeyManagerTest.php   | 59 ++++++++++++++++++++++++++
 apps/encryption/tests/lib/RecoveryTest.php     |  3 +-
 apps/encryption/tests/lib/UtilTest.php         |  4 +-
 8 files changed, 92 insertions(+), 44 deletions(-)

diff --cc apps/encryption/lib/crypto/encryption.php
index 29fda09,c622836..a4abcd7
--- a/apps/encryption/lib/crypto/encryption.php
+++ b/apps/encryption/lib/crypto/encryption.php
@@@ -176,21 -171,10 +176,21 @@@ class Encryption implements IEncryption
  			}
  			$publicKeys = array();
  			foreach ($this->accessList['users'] as $uid) {
 -				$publicKeys[$uid] = $this->keyManager->getPublicKey($uid);
 +				try {
 +					$publicKeys[$uid] = $this->keyManager->getPublicKey($uid);
 +				} catch (PublicKeyMissingException $e) {
 +					$this->logger->warning(
 +						'no public key found for user "{uid}", user will not be able to read the file',
 +						['app' => 'encryption', 'uid' => $uid]
 +					);
 +					// if the public key of the owner is missing we should fail
 +					if ($uid === $this->user) {
 +						throw $e;
 +					}
 +				}
  			}
  
- 			$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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list