-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix for decrypting user specific keys #29072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| $userNo = 1; | ||
| foreach ($userList as $uid) { | ||
| $userCount = "$uid ($userNo of $numberOfUsers)"; | ||
| if (\OC::$server->getAppConfig()->getValue('encryption', 'userSpecificKey', '0') !== '0') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not also do the check on "useMasterKey" here for consistency ? please decide on one condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for not adding "useMasterKey" here is because we already do a check here: https://github.com/owncloud/core/pull/29072/files#diff-6f510adb432497f4f6a446f791729c79R93.
If "userSpecificKey" is enabled, then idea here is that we get the user and we pass it to method prepareEncryptionModules. For "userSpecificKey" the decryption was failing because we relied on https://github.com/owncloud/core/blob/master/lib/private/Encryption/DecryptAll.php#L93
| $this->output->writeln('prepare encryption modules...'); | ||
| if ($this->prepareEncryptionModules($user) === false) { | ||
| return false; | ||
| if (\OC::$server->getAppConfig()->getValue('encryption', 'useMasterKey', '0') !== 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗️
Default value '0' (string) won't be the same as 0 (integer)
I'm not sure what is the expected return type, but please, make sure it matches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvillafanez Yes you are right. I have updated the PR.
9c0f7ef to
5d7eaa9
Compare
This change helps users to decrypt user specific keys. Signed-off-by: Sujith H <sharidasan@owncloud.com>
5d7eaa9 to
878bd4e
Compare
PVince81
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@sharidas backport to stable10 ? |
|
Backport for stable10 -> #29189 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This change helps users to decrypt user
specific keys.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
This change would help users to fix the user specific key encrypted files at oC.
Related Issue
#29081
Motivation and Context
Without this change the decryption was failing files encrypted with user specific keys. With this change both masterkey encrypted files and user key encrypted files can be decrypted successfully.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: