summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorplumbeo <plumbeo@users.noreply.github.com>2022-04-16 17:14:13 +0200
committerplumbeo <plumbeo@users.noreply.github.com>2022-05-04 17:38:25 +0200
commit1258caeab7dec7510781ba7b575390459e2e61e5 (patch)
tree8762cf7c8d0b7406478f1a9cd39da353d0a90647 /lib/private/Files
parent20d7bf8a880ddf41874afdaf3784d29bc1bc925d (diff)
downloadnextcloud-server-1258caeab7dec7510781ba7b575390459e2e61e5.tar.gz
nextcloud-server-1258caeab7dec7510781ba7b575390459e2e61e5.zip
Save encrypted files in binary format
Default to the more space-efficient binary encoding for newly encrypted files instead of the traditional base64 encoding, eliminating the 33% overhead. The new option 'encryption.use_legacy_encoding' allows to force the legacy encoding format if needed. Files encoded in the old format remain readable. Based on https://github.com/owncloud/encryption/pull/224 and https://github.com/owncloud/core/pull/38249 by karakayasemi. Signed-off-by: plumbeo <plumbeo@users.noreply.github.com>
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Stream/Encryption.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php
index e1233e76b93..0f1838c97c8 100644
--- a/lib/private/Files/Stream/Encryption.php
+++ b/lib/private/Files/Stream/Encryption.php
@@ -259,7 +259,6 @@ class Encryption extends Wrapper {
$this->cache = '';
$this->writeFlag = false;
$this->fileUpdated = false;
- $this->unencryptedBlockSize = $this->encryptionModule->getUnencryptedBlockSize($this->signed);
if (
$mode === 'w'
@@ -284,6 +283,7 @@ class Encryption extends Wrapper {
$accessList = $this->file->getAccessList($sharePath);
}
$this->newHeader = $this->encryptionModule->begin($this->fullPath, $this->uid, $mode, $this->header, $accessList);
+ $this->unencryptedBlockSize = $this->encryptionModule->getUnencryptedBlockSize($this->signed);
if (
$mode === 'w'