]> source.dussan.org Git - nextcloud-server.git/commitdiff
bugfixes
authorjknockaert <jasper@knockaert.nl>
Mon, 20 Oct 2014 21:04:11 +0000 (23:04 +0200)
committerjknockaert <jasper@knockaert.nl>
Mon, 20 Oct 2014 21:04:11 +0000 (23:04 +0200)
apps/files_encryption/lib/util.php

index 75cf78c5f946dcded4dbfb7004965873aa14cf21..fcfcbb83f7f529c1d64d9dbdf73d48d314e8e8aa 100644 (file)
@@ -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