mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Added creation of dir for shared file env encryption keys
Added comment to use multiKeyEncrypt
This commit is contained in:
parent
3fbf362ba2
commit
e9f3c5feea
2 changed files with 14 additions and 3 deletions
|
|
@ -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 ) ) {
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Reference in a new issue