summaryrefslogtreecommitdiffstats
path: root/lib/private/files/stream
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-01-05 15:29:44 +0100
committerLukas Reschke <lukas@owncloud.com>2016-02-09 23:43:25 +0100
commitcf3a8f274f05170b69cb3872d0d8c9045a5876d3 (patch)
tree6edd8a9f8327d530320a6ec9a1fb9f1a74a39f48 /lib/private/files/stream
parent40a5ba72fc868207356c9143c99a947f1a6e6500 (diff)
downloadnextcloud-server-cf3a8f274f05170b69cb3872d0d8c9045a5876d3.tar.gz
nextcloud-server-cf3a8f274f05170b69cb3872d0d8c9045a5876d3.zip
make it backward compatible to work with signed and un-signed files
Diffstat (limited to 'lib/private/files/stream')
-rw-r--r--lib/private/files/stream/encryption.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index c884cd8fa07..11e2b218d17 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -110,7 +110,8 @@ class Encryption extends Wrapper {
'size',
'unencryptedSize',
'encryptionStorage',
- 'headerSize'
+ 'headerSize',
+ 'signed'
);
}
@@ -132,6 +133,7 @@ class Encryption extends Wrapper {
* @param int $size
* @param int $unencryptedSize
* @param int $headerSize
+ * @param bool $signed
* @param string $wrapper stream wrapper class
* @return resource
*
@@ -148,6 +150,7 @@ class Encryption extends Wrapper {
$size,
$unencryptedSize,
$headerSize,
+ $signed,
$wrapper = 'OC\Files\Stream\Encryption') {
$context = stream_context_create(array(
@@ -164,7 +167,8 @@ class Encryption extends Wrapper {
'size' => $size,
'unencryptedSize' => $unencryptedSize,
'encryptionStorage' => $encStorage,
- 'headerSize' => $headerSize
+ 'headerSize' => $headerSize,
+ 'signed' => $signed
)
));
@@ -225,7 +229,7 @@ class Encryption extends Wrapper {
$this->position = 0;
$this->cache = '';
$this->writeFlag = false;
- $this->unencryptedBlockSize = $this->encryptionModule->getUnencryptedBlockSize();
+ $this->unencryptedBlockSize = $this->encryptionModule->getUnencryptedBlockSize($this->signed);
if (
$mode === 'w'