Files moved into an encrypted groupfolder are no longer decrypted when needed #2909
Labels
2. developing
Items that are currently under development
bug
feature: encryption
Items related to encryption features of NC
How to use GitHub
When encryption is enabled in both the home storage and in groupfolders and an encrypted file is moved from the home storage into a groupfolder the file is no longer decrypted when needed. That is, trying to download or open the file with a viewer in Nextcloud will show the encrypted content.
During the move the file is properly decrypted and encrypted again and the keys moved. However, the problem is that the file is marked as not encrypted in the file cache. This can be verified by manually modifying the database to set
encrypted = 1
inoc_filecache
for the file once moved into the groupfolder and then trying to download or view the file.The file is marked as not encrypted because the storage in the
Cache
object does not have an encryption wrapper;$this->storage
is aOCA\Files_Trashbin\Storage
that wraps aOC\Files\Storage\LocalRootStorage
(so$this->hasEncryptionWrapper()
returns false).Interestingly, in the
View
object that triggers the move in the cache (through the cache updater)$targetStorage
is aOCA\Files_Trashbin\Storage
that wraps aOC\Files\Storage\Wrapper\Encryption
.I am afraid that I do not know why or how the storage used by the cache ends being a different one, but hopefully the information above is somehow useful :-)
Steps to reproduce
occ app:enable encryption
)occ config:app:set --value=yes --type string core encryption_enabled
)occ config:app:set groupfolders enable_encryption --value="true"
)Expected beaviour
The downloaded file is not encrypted
Actual behaviour
The downloaded file is encrypted
The text was updated successfully, but these errors were encountered: