Commit Graph

6 Commits (5620eed6ef7e1666deb8257d9c8a8485d444d263)

Author SHA1 Message Date
Vincent Petry fd6c5a134f
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>
2021-08-26 14:19:24 +07:00
Vincent Petry 19d2dbf80b Prevent running FixEncryptedVersion without master key
Return an error when running occ encryption:fix-encrypted-version
when master key encryption is not enabled.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-30 12:23:32 +07:00
Vincent Petry b3052e4932 Fix FixEncryptedVersionTest test
Fixed setup to use EncryptionTrait like other existing tests.
Fix expectations to not rely on side effects from previous test cases.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-30 12:23:31 +07:00
Vincent Petry 36a175ccde Fix warnings in FixEncryptedVersion command
Fixed code warnings

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-30 12:23:31 +07:00
Vincent Petry 7e1c807a0d Detect disabled signature check when reparing
When running occ encryption:fix-encrypted-version, detect whether the
setting 'encryption_skip_signature_check' is set and abort if it is,
because the repair cannot detect version mismatch errors with it
enabled.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-30 12:23:31 +07:00
Vincent Petry 3db068ecb3 Downstream encryption:fix-encrypted-version
For fixing "Bad signature" errors.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-30 12:23:30 +07:00