Commit Graph

349 Commits (9cd49cbe340a20dcb95151945b8b6ff4583db7d7)

Author SHA1 Message Date
Stephan Orbaugh e7d02a6e5f
Merge pull request #56189 from nextcloud/fix/do-not-test-encryption-on-grant
fix(encryption): Add the script to test encryption status only on logged in pages
2025-11-13 16:54:05 +07:00
Côme Chilliet 71688e3b8e
Merge pull request #56167 from nextcloud/fix/fix-encryption-with-user-keys
fix(encryption): Fix user key support with basic auth
2025-11-13 11:51:59 +07:00
Côme Chilliet 928a45c677
fix(encryption): Fix user key support with basic auth
When using basic authentication the user is not logged in yet when
 KeyManager constructor gets called, so we need to delay the check for
 the loggedin user uid.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-10 18:11:01 +07:00
Hamza f1cdf6885e feat: add occ command to scan and selete orphaned keys
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
2025-11-04 16:56:35 +07:00
Côme Chilliet ca8b04f331
fix(encryption): Add the script to test encryption status only on logged in pages
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-04 14:52:58 +07:00
Carl Schwan a3442be054 refactor: fix psalm issues from encryption commands
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-01 16:07:41 +07:00
provokateurin d59338b377
refactor: Apply rector Nextcloud 26 set
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-28 11:45:52 +07:00
Ferdinand Thiessen 7cc3c1f669
fix(encryption): do not setup filesystem without permissions
If the current request does not have permissions for the filesystem we
must not try to setup the filesystem.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-20 22:23:12 +07:00
Côme Chilliet 8330f149b0
chore(encryption): Remove unused attribute $uid in KeyManager::getFileKey
It’s a private API in the application, no need to keep an unused
 attribute.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:28 +07:00
Côme Chilliet bfcb2690f4
chore: Improve wording of logged error in apps/encryption/lib/KeyManager.php
Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2025-09-09 11:46:19 +07:00
Côme Chilliet bc5e29f9f2
fix(tests): Fix type issues and other problems with encryption tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +07:00
Côme Chilliet 94254db001
chore(encryption): Cleanup typing in EncryptAll/DecryptAll
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +07:00
Côme Chilliet b74c7538ac
fix(encryption): Do not depend upon user in session unless really necessary
Should fix a bunch of stuff when encryption listener is triggered by events from occ commands or background jobs

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:17 +07:00
Côme Chilliet f95fef9938
chore(encryption): Adapt tests to code changes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-04 11:53:19 +07:00
Côme Chilliet d711d68701
fix(encryption): Ignore shared files in encrypt-all command
Copying and renaming a share will not encrypt it anyway. It will get
 encrypted when the owner’s files get encrypted.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-04 10:42:04 +07:00
provokateurin 5bd626bd40
chore: Fix all method calls with too many arguments
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-07-22 12:34:49 +07:00
Côme Chilliet 4427050f84 fix(encryption): Correctly handle file opening and copying failures
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-03 15:19:34 +07:00
Côme Chilliet 1285ebc3cf fix(encryption): Catch exceptions in encrypt-all command and continue
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-03 15:19:34 +07:00
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
Côme Chilliet f6365e76a1
fix(encryption): Do not register user key related event listeners
when master key is enabled.
Also added a safeguard in PassphraseService.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-16 15:52:41 +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
Ferdinand Thiessen a3c2600386
fix(encryption): init keys also when logged in using cookie auth
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-02 00:06:10 +07:00
Ferdinand Thiessen 313d2219fd
fix(encryption): Listen for user login and logout to set encryption key
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-06 17:22:51 +07:00
provokateurin e8426996f5
fix(psalm): Fix some newly detected issues
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +07:00
provokateurin 381077028a
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +07:00
Ferdinand Thiessen f3aa004b1c
refactor(encryption): Migrate away from Hooks to typed events
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Louis <louis@chmn.me>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-15 18:33:06 +07:00
Côme Chilliet 1580c8612b
chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-10-15 10:40:25 +07:00
provokateurin 51d9d63a01
chore: Use more gender neutral language
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-14 13:59:24 +07:00
Côme Chilliet 1a4978c4ea
chore: Apply rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-20 17:51:00 +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
provokateurin 4016aace04
refactor(encryption): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-27 21:32:47 +07:00
Louis Chemineau 39fd19f1d6 refactor(encryption): Migrate app.php to Application.php
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-01 13:45:09 +07:00
Côme Chilliet 885604ce2d
fix: add default value for new flag `$useDecryptAll` on getFileKey
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-06-06 10:23:03 +07:00
Côme Chilliet 95cd524771
fix: Autodetect legacy filekey instead of trusting the header for legacy header
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-06-04 17:20:20 +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
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +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
Hamid Dehnavi d64bbc8bd3 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 12:18:41 +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 3e176f58af Improve typing as suggested by review
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-08 09:14:16 +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 bd08849866
Fix sharing of encrypted files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-07-18 09:42:57 +07:00
rakekniven 9646474e9a fix(i18n) Changed grammar related to "login"
Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2023-07-15 15:51:53 +07:00
Côme Chilliet 2a6f347430 Increase from 100000 to 600000 iterations for hash_pbkdf2
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-23 20:53:33 +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