Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
...
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
# Conflicts:
# apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +07:00
Robin Appelman
b0b8159d6a
fix: throw a better error if we can't get the encrypted header size
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-09 22:33:45 +07:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
...
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Faraz Samapoor
6b795da540
Uses early returns.
...
To improve code readability.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2024-08-16 09:33:16 +07:00
Faraz Samapoor
fc8b886295
Refactors encryption app commands.
...
To improve code readability.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2024-08-16 09:33:16 +07:00
Andy Scherzinger
5b7dcc1427
chore: Add SPDX header
...
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-29 08:58:16 +07:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Robin Appelman
e4f85226c5
extend fix-key-location to handle cases from broken cross-storage moves
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-08-31 19:46:47 +07:00
Côme Chilliet
1e06b61f59
Migrate away from ILogger in encryption
...
And modernize code a bit
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-08 09:14:16 +07:00
Côme Chilliet
49108880d2
Add fclose on opened resources
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-11 17:53:19 +07:00
Côme Chilliet
a92028f5cd
Rename command to drop-legacy-filekey and remove comment about legacy mode.
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-11 11:56:14 +07:00
Côme Chilliet
36fc5dc8ae
Copy data back instead of renaming to avoid changing the fileid
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-11 11:24:16 +07:00
Côme Chilliet
725403cb0d
Copy and move files to migrate them to the new key
...
We have to rewrite the header, so the whole file needs to be rewritten,
so we just use the same strategy as DecryptAll.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-09 12:02:57 +07:00
Côme Chilliet
146284f170
Fix fopen mode
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-04 17:50:34 +07:00
Côme Chilliet
5663f9b31e
Add an occ command to scan files for legacy file key in use and get rid of those
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-04 16:53:25 +07:00
Vincent Petry
3bcbc4701a
Merge pull request #34724 from nextcloud/encryption-read-before-cache
...
fix reading newly written encrypted files before their cache entry is written
2022-12-20 17:16:12 +07:00
Vincent Petry
4f2923862a
Merge pull request #35108 from nextcloud/encryption-fix-versions-all
...
allow running encryption:fix-encrypted-version for all users
2022-12-16 17:20:40 +07:00
J0WI
71e490090f
Replace getSystemValue in encryption app
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2022-12-05 14:30:58 +07:00
Robin Appelman
e3a0e64698
clear is-encrypted cache when trying to fix encrypted version
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-01 14:36:27 +07:00
Robin Appelman
2399710356
allow running encryption:fix-encrypted-version for all users
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-29 17:49:35 +07:00
Robin Appelman
dd4ebbd72a
add migration for encryption keys in wrong location
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-28 16:12:11 +07:00
Robin Appelman
06b2ed2641
skip files that cant be opened for FixEncryptedVersion
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-22 16:40:12 +07:00
Côme Chilliet
b20278f708
Fix encryption:fix-encrypted-version command when encrypted is set to 0
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-02 12:47:26 +07:00
Côme Chilliet
bd467e5d66
Improve typing in FixEncryptedVersion command
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-02 12:11:15 +07:00
Côme Chilliet
37f8f7a5a1
Fix tests on PHP 8.1 for encryption, files_sharing, files_version,
...
files_trashbin and theming apps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-16 09:43:29 +07:00
Vincent Petry
60e44077b7
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 10:44:49 +07:00
Gary Kim
b78f3a57d1
Migrate HintException to OCP
...
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-06-30 15:28:02 +07:00
Vincent Petry
d3eeecba54
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-29 20:44:07 +07:00
Vincent Petry
101c65a949
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-29 14:39:51 +07:00
Vincent Petry
6170912ace
Fix warnings in FixEncryptedVersion command
...
Fixed code warnings
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-29 14:39:51 +07:00
Vincent Petry
4e9241c706
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-29 14:39:51 +07:00
Vincent Petry
a6dc81d419
Downstream encryption:fix-encrypted-version
...
For fixing "Bad signature" errors.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-06-29 14:39:51 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
essys
fdcfc4edce
Update ScanLegacyFormat.php
...
Fixed a small typo on line 99.
2020-11-20 10:16:35 +07:00
Christoph Wurst
2a054e6c04
Update the license headers for Nextcloud 20
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
Roeland Jago Douma
2bbb848c31
Add legacy scanning command
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-19 15:45:45 +07:00
Joas Schilling
d7c0b9cced
Also always return in app commands
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-26 15:12:11 +07:00
Christoph Wurst
cb057829f7
Update license headers for 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
...
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +07:00
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
...
For PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +07:00
Christoph Wurst
74936c49ea
Remove unused imports
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +07:00
Christoph Wurst
5bf3d1bb38
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
...
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +07:00
Bjoern Schiessle
3adc2aca53
add occ command to recover encrypted files in case of password lost
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-16 15:51:01 +07:00
Bjoern Schiessle
8042e6b8fb
this was a migration step to ownCloud 8.0 to restructure the encryption folder which is no longer needed
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-03-02 10:09:52 +07:00
Morris Jobke
0eebff152a
Update license headers
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +07:00
Bjoern Schiessle
66debbe18e
add occ command to disable the master key again
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-07-06 11:47:11 +07:00
Thomas Müller
8628d57b2c
Move console command registration to info.xml for encryption as well as files_external
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-12 08:04:15 +07:00