Commit Graph

328 Commits (58aaddeca571a3efcc710f4f1dbac837deeedb61)

Author SHA1 Message Date
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
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 c9c49bfef8
Log failures to delete legacy file key
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-04 17:50:51 +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
Christoph Wurst b952066140
Merge pull request #37724 from nextcloud/fix/encryption-signature-check-logic
Cleanup signature checking logic in encryption
2023-04-17 17:39:34 +07:00
Joas Schilling 0b88b513be
Merge pull request #36351 from nextcloud/bugfix/noid/move-encryption-password-email-to-template
Move encrypt-all password email to EmailTemplate
2023-04-14 14:48:47 +07:00
jld3103 2f653c8be8
Cleanup signature checking logic in encryption
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-04-14 09:07:20 +07:00
Côme Chilliet 430009b8e2
Add a test for multiKeyEncrypt/Decrypt methods
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-20 14:19:13 +07:00
Côme Chilliet 24e762c59f
Fix encryption file key management
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-17 11:08:59 +07:00
Côme Chilliet 8900d030d1
Adapt code to new encryption system
fileKey gets deleted upon save as it’s stored in shareKeys instead now.
We use presence of a fileKey to detect if a file is using the legacy
 system or the new one, because we do not always have access to header
 data.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-17 11:08:58 +07:00
Côme Chilliet fbe282caeb
Getting rid of openssl_seal and rc4 in server side encryption
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-17 11:08:50 +07:00
Joas Schilling 0f7146c652
Move encrypt-all password email to EmailTemplate
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-08 12:15:18 +07:00
Côme Chilliet f2912ce8bc Set functions as private to be able to refactor later
Also a few comment fixes

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-21 13:36:25 +07:00
Côme Chilliet 71482576ad Move to phpseclib implementation of RC4
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-21 13:36:25 +07:00
Côme Chilliet bd626e3693 Strong type custom openssl_seal implementation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-21 13:36:25 +07:00
Côme Chilliet deed6393fb Always wrap rc4, and throws on unknown cipher
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-21 13:36:25 +07:00
Kevin Niehage 81638436e5 introduce wrapped_openssl_seal() and wrapped_openssl_open() to circument RC4 problems with OpenSSL v3
Signed-off-by: Kevin Niehage <k.niehage@syseleven.de>
2023-02-21 13:36:25 +07:00
Côme Chilliet 7ebbb6b2ca
Remove workarounds specific to 7.4
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:22:08 +07:00
Côme Chilliet 9430899f16
Fix psalm issues related to signature changes from PHP 8.0
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-29 12:36:34 +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