aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-05-09 16:37:06 +0200
committerRobin Appelman <robin@icewind.nl>2025-05-09 22:33:45 +0200
commitb0b8159d6a3777c1c7b9cfa1c5e74974b5c0273c (patch)
treee91fc980d304289a4a5ca0dd3ada4c8c9d3a9f54 /apps/encryption
parentc7430d5cb806ac2cf84d2e6e7ae1da3f50375828 (diff)
downloadnextcloud-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.php3
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) {