diff options
author | Robin Appelman <robin@icewind.nl> | 2025-05-09 16:37:06 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-05-09 22:33:45 +0200 |
commit | b0b8159d6a3777c1c7b9cfa1c5e74974b5c0273c (patch) | |
tree | e91fc980d304289a4a5ca0dd3ada4c8c9d3a9f54 /apps/encryption | |
parent | c7430d5cb806ac2cf84d2e6e7ae1da3f50375828 (diff) | |
download | nextcloud-server-encryption-no-header-size-error.tar.gz nextcloud-server-encryption-no-header-size-error.zip |
fix: throw a better error if we can't get the encrypted header sizeencryption-no-header-size-error
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/encryption')
-rw-r--r-- | apps/encryption/lib/Command/FixEncryptedVersion.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php index 6635bb6cba9..462e3a5cc2a 100644 --- a/apps/encryption/lib/Command/FixEncryptedVersion.php +++ b/apps/encryption/lib/Command/FixEncryptedVersion.php @@ -12,6 +12,7 @@ use OC\Files\Storage\Wrapper\Encryption; use OC\Files\View; use OC\ServerNotAvailableException; use OCA\Encryption\Util; +use OCP\Encryption\Exceptions\InvalidHeaderException; use OCP\Files\IRootFolder; use OCP\HintException; use OCP\IConfig; @@ -196,7 +197,7 @@ class FixEncryptedVersion extends Command { \fclose($handle); return true; - } catch (ServerNotAvailableException $e) { + } catch (ServerNotAvailableException|InvalidHeaderException $e) { // not a "bad signature" error and likely "legacy cipher" exception // this could mean that the file is maybe not encrypted but the encrypted version is set if (!$this->supportLegacy && $ignoreCorrectEncVersionCall === true) { |