]> source.dussan.org Git - nextcloud-server.git/commitdiff
always use default cipher for write operations, no matter how the file was encrypted...
authorBjörn Schießle <bjoern@schiessle.org>
Tue, 5 Jan 2016 15:34:40 +0000 (16:34 +0100)
committerLukas Reschke <lukas@owncloud.com>
Tue, 9 Feb 2016 22:43:25 +0000 (23:43 +0100)
apps/encryption/lib/crypto/encryption.php

index 4843284f7a3178c15bf125c54ae0cca54ddbbe8f..dc60c0947849eea3236e515184f9e67e5a71f883 100644 (file)
@@ -192,10 +192,10 @@ class Encryption implements IEncryptionModule {
                        }
                }
 
-               if (isset($header['cipher'])) {
-                       $this->cipher = $header['cipher'];
-               } elseif ($this->isWriteOperation) {
+               if ($this->isWriteOperation) {
                        $this->cipher = $this->crypt->getCipher();
+               } elseif (isset($header['cipher'])) {
+                       $this->cipher = $header['cipher'];
                } else {
                        // if we read a file without a header we fall-back to the legacy cipher
                        // which was used in <=oC6