Skip to content

Commit ce953d1

Browse files
authored
Merge pull request #24532 from nextcloud/backport/24409/stable20
[stable20] Also run repair steps when encryption is disabled but a legacy key is present
2 parents 1a041f7 + 14d95cb commit ce953d1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/private/Repair/NC20/EncryptionLegacyCipher.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public function run(IOutput $output): void {
5858
return;
5959
}
6060

61-
if ($this->manager->isEnabled()) {
61+
$masterKeyId = $this->config->getAppValue('encryption', 'masterKeyId');
62+
if ($this->manager->isEnabled() || !empty($masterKeyId)) {
6263
if ($this->config->getSystemValue('encryption.legacy_format_support', '') === '') {
6364
$this->config->setSystemValue('encryption.legacy_format_support', true);
6465
}

lib/private/Repair/NC20/EncryptionMigration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public function run(IOutput $output): void {
5858
return;
5959
}
6060

61-
if ($this->manager->isEnabled()) {
61+
$masterKeyId = $this->config->getAppValue('encryption', 'masterKeyId');
62+
if ($this->manager->isEnabled() || !empty($masterKeyId)) {
6263
if ($this->config->getSystemValue('encryption.key_storage_migrated', '') === '') {
6364
$this->config->setSystemValue('encryption.key_storage_migrated', false);
6465
}

0 commit comments

Comments
 (0)