summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjknockaert <jasper@knockaert.nl>2014-10-20 23:04:11 +0200
committerjknockaert <jasper@knockaert.nl>2014-10-20 23:04:11 +0200
commitd277ef6ac265a108a19ca725c4eea68b29e0e472 (patch)
tree63fc1ce9f8ca1feaf4fb34963d9b98e2bddff376 /apps
parent1b7e9d66b31553f6a257638c868fd16f1a8e8e4b (diff)
downloadnextcloud-server-d277ef6ac265a108a19ca725c4eea68b29e0e472.tar.gz
nextcloud-server-d277ef6ac265a108a19ca725c4eea68b29e0e472.zip
bugfixes
Diffstat (limited to 'apps')
-rw-r--r--apps/files_encryption/lib/util.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 75cf78c5f94..fcfcbb83f7f 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -435,15 +435,16 @@ class Util {
$lastChunkContentEncrypted=substr($lastChunkContentEncrypted,Crypt::BLOCKSIZE);
}
}
-
+ fclose($stream);
$relPath = \OCA\Encryption\Helper::stripUserFilesPath($path);
- $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
+ $shareKey = Keymanager::getShareKey($this->view, $this->keyId, $this, $relPath);
+ if($shareKey===false) {
+ return $result;
+ }
+ $session = new \OCA\Encryption\Session($this->view);
$privateKey = $session->getPrivateKey();
$plainKeyfile = $this->decryptKeyfile($relPath, $privateKey);
- $shareKey = Keymanager::getShareKey($this->view, $this->keyId, $this, $relPath);
-
$plainKey = Crypt::multiKeyDecrypt($plainKeyfile, $shareKey, $privateKey);
-
$lastChunkContent=Crypt::symmetricDecryptFileContent($lastChunkContentEncrypted, $plainKey, $cipher);
// calc the real file size with the size of the last chunk