Consider file to be encrypted only if it has encrypted property set#36921
Consider file to be encrypted only if it has encrypted property set#36921
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Codecov Report
@@ Coverage Diff @@
## master #36921 +/- ##
============================================
+ Coverage 64.29% 64.75% +0.46%
- Complexity 19135 19137 +2
============================================
Files 1270 1270
Lines 74872 74909 +37
Branches 1329 1329
============================================
+ Hits 48137 48506 +369
+ Misses 26344 26012 -332
Partials 391 391
Continue to review full report at Codecov.
|
05532cf to
53065d1
Compare
| $targetIsEncrypted = true; | ||
| $encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId); | ||
| $data = $this->storage->getCache()->get($path); | ||
| if ($data) { |
There was a problem hiding this comment.
$data = $this->storage->getCache()->get($path);
if (isset($data['encrypted']) && $data['encrypted'] === true) {
$encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
}
It seems a bit better to me. I'm not sure if we need the $targetIsEncrypted but we can assign it inside the condition if needed.
We might also need a comment with a little explanation, because accessing the storage cache could be expensive. I don't think we can avoid it at the moment, but maybe someone could have a better idea in the future.
There was a problem hiding this comment.
accessing the storage cache could be expensive
True. But it happens only if we have found an encrypted header in the line 383
As for replacing $targetIsEncrypted with $encryptionModule - this var is matches it's content perfectly.
In addition it was not added by me and is used below this point several times.
There was a problem hiding this comment.
As for replacing
$targetIsEncryptedwith$encryptionModule- this var is matches it's content perfectly.
I didn't want to replace it. I just didn't see where the $targetIsEncrypted was being used
$data = $this->storage->getCache()->get($path);
if (isset($data['encrypted']) && $data['encrypted'] === true) {
$targetIsEncrypted = true;
$encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
}
I can live with the above
There was a problem hiding this comment.
thanks for the clarification. updated.
4d2a082 to
00dc0a2
Compare
00dc0a2 to
baff6ec
Compare
Description
Consider a file to be encrypted only if it has encrypted property set to true
Related Issue
https://github.com/owncloud/enterprise/issues/1739#issuecomment-393223048
Motivation and Context
It's not possible to download file that is encrypted externally
How Has This Been Tested?
Expected
File is downloaded
Actual
Web UI shows an error:
Types of changes
Checklist: