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
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
Carl Schwan
aeecb72e96
Fix a few psalm issues and moved back to psalm/phar 4.18
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-12 20:03:06 +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
J0WI
91051d9207
Generate strong, human readable OTP
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-07-08 15:11:33 +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
Julius Härtl
75f7287b5e
Merge pull request #27638 from nextcloud/enh/noid/fix-encrypted-version
2021-06-30 14:17:38 +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
J0WI
c694b9d52b
Remember current cipher
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-06-29 13:41:22 +07:00
blizzz
c6d5653a85
Merge pull request #26323 from J0WI/crypt-const
...
Use constant for supported formats
2021-06-23 11:17:05 +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
Valdnet
b9d00a96b3
l10n: Unify spelling
...
Spelling unification in Nextcloud applications.
2021-05-20 09:22:07 +07:00
Roeland Jago Douma
7c30d1aa2d
Merge pull request #26219 from nextcloud/relative-path-null
...
getRelativePath can return null
2021-03-30 21:10:05 +07:00
J0WI
e617361250
Use constant for supported formats
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-03-26 19:24:04 +07:00
J0WI
21494a5b7b
Drop OpenSSL 0.9.8 workaround
...
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-03-26 19:23:10 +07:00
Robin Appelman
8a92229485
getStorage can also return null
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 14:56:40 +07:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
...
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard ) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases )
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md )
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Roeland Jago Douma
918af40f05
Harden EncryptAll check for empty email
...
Reported by psalm
For #25641
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-02-15 22:28:28 +07:00
Morris Jobke
24d436cb60
Remove unneeded casts that were found by Psalm
...
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521 )
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-11 13:14: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
Roeland Jago Douma
b3037dee6a
FIXME use default RC4 method
...
* We should pick better default method!
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-12-07 15:44:04 +07:00
Roeland Jago Douma
98eede7f68
Fix encryption test
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-12-07 15:44:04 +07:00
Morris Jobke
dc5f17f561
Merge pull request #24288 from nextcloud/techdebt/noid/encryption-setup-dependency-cleanup
...
Remove unused dependencies in encryption app setup
2020-11-23 20:43:42 +07:00
Morris Jobke
c832e6180b
Remove unused dependencies in encryption app setup
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-23 16:20:00 +07:00
Morris Jobke
efe644137d
[encryption] Remove dependency fetching inside the constructor and move them to method call parameters
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-22 22:35:02 +07:00