summaryrefslogtreecommitdiffstats
path: root/lib/private/files/stream
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-04-24 16:47:27 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-04-24 16:47:27 +0200
commit9a5783b28434762aeb05ce62627a5adb675e5560 (patch)
tree01d5fa3850ead5eae49ed79283a74589363f5f18 /lib/private/files/stream
parent4554df2512aadbbed22650515c2fb5c85651ef42 (diff)
downloadnextcloud-server-9a5783b28434762aeb05ce62627a5adb675e5560.tar.gz
nextcloud-server-9a5783b28434762aeb05ce62627a5adb675e5560.zip
fix unit tests
Diffstat (limited to 'lib/private/files/stream')
-rw-r--r--lib/private/files/stream/encryption.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index 52660270763..5f39207db87 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -237,7 +237,6 @@ class Encryption extends Wrapper {
$accessList = $this->file->getAccessList($sharePath);
$this->newHeader = $this->encryptionModule->begin($this->fullPath, $this->uid, $this->header, $accessList);
- if (!($path==='')){
if (
$mode === 'w'
|| $mode === 'w+'
@@ -249,9 +248,9 @@ class Encryption extends Wrapper {
$this->writeHeader();
$this->size = $this->util->getHeaderSize();
} else {
- parent::stream_read($this->util->getHeaderSize());
- }
+ $this->skipHeader();
}
+
return true;
}
@@ -432,9 +431,16 @@ class Encryption extends Wrapper {
* @return integer
* @throws EncryptionHeaderKeyExistsException if header key is already in use
*/
- private function writeHeader() {
+ protected function writeHeader() {
$header = $this->util->createHeader($this->newHeader, $this->encryptionModule);
return parent::stream_write($header);
}
+ /**
+ * read first block to skip the header
+ */
+ protected function skipHeader() {
+ parent::stream_read($this->util->getHeaderSize());
+ }
+
}