Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 3 gadiem
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 3 gadiem
Christoph Wurst
2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 3 gadiem
Morris Jobke
5a064ec28b
Fix typo in error message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pirms 3 gadiem
Julius Härtl
36cfdd320b
Harden key generation
There might be cases where multiple requests trigger the key generation
at the same time and the instance ends up with a non-fitting
public/private key pair. Therefore the whole key generation should be
locked. Other than that this makes sure that user key generation return
values are properly validated.
Signed-off-by: Julius Härtl <jus@bitgrid.net>
pirms 3 gadiem
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 4 gadiem
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>
pirms 4 gadiem
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 4 gadiem
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pirms 4 gadiem
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>
pirms 4 gadiem
Arthur Schiwon
38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pirms 6 gadiem
Morris Jobke
a661f043e1
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pirms 6 gadiem
Morris Jobke
2a38605545
Properly log the full exception instead of only the message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pirms 6 gadiem
Morris Jobke
0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pirms 6 gadiem
Bjoern Schiessle
28a7e72868
after the master key was loaded we are ready to go, no re-login needed
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
pirms 7 gadiem
Morris Jobke
1729e4471f
Update comments to Nextcloud
* based on PR by @Ardinis
* see #4311
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pirms 7 gadiem
Vincent Petry
6b9ef15803
Use master key for public links as well
pirms 7 gadiem
Vincent Petry
43c081bdc9
Fix public link for master key
In public link mode there is no session, so the code should use the
public key instead.
pirms 7 gadiem
Bjoern Schiessle
fcda3a20f4
create new encryption keys on password reset and backup the old one
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
pirms 7 gadiem
Bjoern Schiessle
8a401ee156
check if session is initialized
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
pirms 7 gadiem
Maxence Lange
558a934842
init Session/privateKeys on Master Key
I can't find another way to init the session ...
pirms 7 gadiem
Joas Schilling
5e5e5b77d5
Fix encryption app
pirms 7 gadiem
Joas Schilling
813f0a0f40
Fix apps/
pirms 7 gadiem
Lukas Reschke
aba539703c
Update license headers
pirms 8 gadiem
Björn Schießle
0f728b4cd1
don't fail on "bad signature" during login. Most likely this happens because
the login password changed at the user back-end (e.g ldap). Such failures will
be handled after login correctly by allowing the user to adjust the passwords
pirms 8 gadiem
Joas Schilling
4a3311f430
Move Encryption app to PSR-4 (#24524)
* Move Encryption to PSR-4
* Move encryption tests to PSR-4
* Fix the tests
pirms 8 gadiem
Bjoern Schiessle
d86f8ba5f8
if we don't have a encrypted file key we can return a empty string right away
pirms 8 gadiem
Thomas Müller
50e20e531e
Introduce isReadyForUser and verify in file transfer ownership - fixes #23786
pirms 8 gadiem
Bjoern Schiessle
89223379ad
replaceUserKeys() actually deletes the users keys -> update method name and doc-block
pirms 8 gadiem
Bjoern Schiessle
5e267589d4
only create and update user specific key if no master key is enabled
pirms 8 gadiem
Lukas Reschke
c353d51810
Remove Scrutinizer Auto Fixer
pirms 8 gadiem
Lukas Reschke
933f60e314
Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
pirms 8 gadiem
Bjoern Schiessle
95ea2ccb53
make decrypt all work with the master key
pirms 8 gadiem
Vincent Petry
45c78476f5
Use cache update instead of put for encryption version
Saves a call to fetch the file id which didn't even work for a reason.
This fix properly sets the version in the database.
pirms 8 gadiem
Lukas Reschke
6724f76573
Use cache and add tests
pirms 8 gadiem
Lukas Reschke
5ccb9dfa7e
Use database for keeping track of the version
pirms 8 gadiem
Lukas Reschke
b5824f024a
Keep track of file version
This way it is not possible anymore for an external storage admin to put up old versions of the file.
pirms 8 gadiem
Thomas Müller
682821c71e
Happy new year!
pirms 8 gadiem
Björn Schießle
46f6c289ca
only use master key ID if a user is logged in. Otherwise keep the public link share key
pirms 8 gadiem
Lukas Reschke
00a01a8de2
Fix PHPDoc + Add handling for error cases
Makes static code analyzers happier.
pirms 8 gadiem
Scrutinizer Auto-Fixer
be4c3a8b56
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pirms 8 gadiem
Bjoern Schiessle
acfc7d7c4d
enable usage of a master key
pirms 8 gadiem
Bjoern Schiessle
854fd63ea9
use uid as additional information for salt
pirms 8 gadiem
Bjoern Schiessle
62bc0e5264
use password hash instead of the plain password to encrypt the private key
pirms 8 gadiem
Bjoern Schiessle
1e284b15ff
only create new key pair if both keys are missing
pirms 9 gadiem
Bjoern Schiessle
ccbefb6e75
delete all file keys doesn't need the encryption module as parameter; implement rmdir; getFileKeyDir should also work for part files and complete directories
pirms 9 gadiem
Bjoern Schiessle
70a44621be
check recovery setting for the right user
pirms 9 gadiem
Thomas Müller
fc4127dd62
add $encryptionModuleId to methods of Keys/IStorage
pirms 9 gadiem
Thomas Müller
c6e243928c
move creation of shared key to the login handler - fixes #15705
pirms 9 gadiem
Bjoern Schiessle
e93f262eac
display warning if password changed or if the keys are not initialized
pirms 9 gadiem