summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/crypto
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-26 13:37:14 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:27 +0200
commit6c9251d9f8bd105ed5e3a99e124f0bab997fb477 (patch)
tree55e148c2fa032e871c84e902b528520ffc4e9ad8 /apps/encryption/lib/crypto
parentcb9980823d62ab1ed843779bcac65152ed5379fe (diff)
downloadnextcloud-server-6c9251d9f8bd105ed5e3a99e124f0bab997fb477.tar.gz
nextcloud-server-6c9251d9f8bd105ed5e3a99e124f0bab997fb477.zip
make sure that all file keys are written to the key storage
Diffstat (limited to 'apps/encryption/lib/crypto')
-rw-r--r--apps/encryption/lib/crypto/encryption.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php
index 66cb1dc434b..516d7b1304a 100644
--- a/apps/encryption/lib/crypto/encryption.php
+++ b/apps/encryption/lib/crypto/encryption.php
@@ -117,11 +117,16 @@ class Encryption implements IEncryptionModule {
$this->writeCache = '';
}
$publicKeys = array();
- foreach ($this->accessList['users'] as $user) {
- $publicKeys[] = $this->keymanager->getPublicKey($user);
+ foreach ($this->accessList['users'] as $uid) {
+ $publicKeys[$uid] = $this->keymanager->getPublicKey($uid);
}
- $result = $this->crypt->multiKeyEncrypt($this->fileKey, $publicKeys);
+ $encryptedKeyfiles = $this->crypt->multiKeyEncrypt($this->fileKey, $publicKeys);
+
+ $this->keymanager->setFileKey($path, $encryptedKeyfiles['data']);
+ foreach ($encryptedKeyfiles['keys'] as $uid => $keyFile) {
+ $this->keymanager->setShareKey($path, $uid, $keyFile);
+ }
}
return $result;
}