summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rwxr-xr-xapps/files_encryption/lib/crypt.php2
-rw-r--r--apps/files_encryption/lib/util.php15
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index fddc89dae54..642187b9103 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -390,6 +390,8 @@ class Crypt {
*/
public static function multiKeyEncrypt( $plainContent, array $publicKeys ) {
+ // Set empty vars to be set by openssl by reference
+ $sealed = '';
$envKeys = array();
if( openssl_seal( $plainContent, $sealed, $envKeys, $publicKeys ) ) {
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index cd46d23108a..56e4d572c24 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -96,9 +96,10 @@ class Util {
private $view; // OC_FilesystemView object for filesystem operations
private $pwd; // User Password
private $client; // Client side encryption mode flag
- private $publicKeyDir; // Directory containing all public user keys
- private $encryptionDir; // Directory containing user's files_encryption
- private $keyfilesPath; // Directory containing user's keyfiles
+ private $publicKeyDir; // Dir containing all public user keys
+ private $encryptionDir; // Dir containing user's files_encryption
+ private $keyfilesPath; // Dir containing user's keyfiles
+ private $shareKeysPath; // Dir containing env keys for shared files
private $publicKeyPath; // Path to user's public key
private $privateKeyPath; // Path to user's private key
@@ -110,6 +111,7 @@ class Util {
$this->publicKeyDir = '/' . 'public-keys';
$this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
$this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
+ $this->shareKeysPath = $this->encryptionDir . '/' . 'share-keys';
$this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
$this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
@@ -159,6 +161,13 @@ class Util {
$this->view->mkdir( $this->keyfilesPath );
}
+
+ // Create mirrored share env keys directory
+ if( !$this->view->file_exists( $this->shareKeysPath ) ) {
+
+ $this->view->mkdir( $this->shareKeysPath );
+
+ }
// Create user keypair
if (