]> source.dussan.org Git - nextcloud-server.git/commitdiff
in case the file exists we require the explicit module as specified in the file heade...
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 1 Apr 2015 14:35:46 +0000 (16:35 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:30 +0000 (13:30 +0200)
lib/private/files/storage/wrapper/encryption.php

index 3e98098419160d7333328d43f78f94cfca715f98..09ba090acffd64210ba96bd7c7b37b151162869a 100644 (file)
@@ -219,6 +219,12 @@ class Encryption extends Wrapper {
 
                $size = $unencryptedSize = 0;
                if ($this->file_exists($path)) {
+                       // in case the file exists we require the explicit module as
+                       // specified in the file header - otherwise we need to fail hard to
+                       // prevent data loss on client side
+                       if (!empty($encryptionModuleId)) {
+                               $encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
+                       }
                        $size = $this->storage->filesize($path);
                        $unencryptedSize = $this->filesize($path);
                }