Commit Graph

319 Commits (c224b8ced4e8e9ea2b69eca49ba258c45542e346)

Author SHA1 Message Date
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
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
luz paz 9d26671f05 Fix typos in apps/ subdirectory
Found via `codespell -q 3 -S l10n,./apps/files_external/3rdparty -L adn,ba,boxs,keypair,jus,optionel,ressource,tabel ./apps/`

Signed-off-by: luz paz <luzpaz@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-09-05 12:59:54 +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
plumbeo 1258caeab7 Save encrypted files in binary format
Default to the more space-efficient binary encoding for newly encrypted files
instead of the traditional base64 encoding, eliminating the 33% overhead.

The new option 'encryption.use_legacy_encoding' allows to force the legacy
encoding format if needed. Files encoded in the old format remain readable.

Based on https://github.com/owncloud/encryption/pull/224 and
https://github.com/owncloud/core/pull/38249 by karakayasemi.

Signed-off-by: plumbeo <plumbeo@users.noreply.github.com>
2022-05-04 17:38:25 +07:00