]> source.dussan.org Git - nextcloud-server.git/commit
Fix encrypted version to 0 when finding unencrypted file
authorVincent Petry <vincent@nextcloud.com>
Wed, 11 Aug 2021 07:18:16 +0000 (09:18 +0200)
committerVincent Petry <vincent@nextcloud.com>
Thu, 26 Aug 2021 12:19:24 +0000 (14:19 +0200)
commitfd6c5a134ffe63c1f880723a6b85ab1c124e2eec
treef4f6e6a3d85013f9a557fd698c274528ada5f452
parentc81fd490c45c790da18dd35ca2a2c542eee55d1d
Fix encrypted version to 0 when finding unencrypted file

Whenever the command is run and a "legacy cipher" seems to be detected
when the legacy option is disabled, it's highly likely that the file is
actually unencrypted but the database contains a encrypted version
higher than 0 for some reason.

The command now detects this case and automatically sets the encrypted
version to 0 so that the file can be read again.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
apps/encryption/lib/Command/FixEncryptedVersion.php
apps/encryption/tests/Command/FixEncryptedVersionTest.php