-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix encryption stream for 2.0 #15305
Conversation
@DeepDiver1975 That's quite a bit more changes than I submit in #15303 |
// get into an infinite loop | ||
$encrypted = $this->encryptionModule->encrypt($this->cache); | ||
parent::stream_write($encrypted); | ||
$this->writeFlag = false; | ||
$this->encryptionStorage->updateUnencryptedSize($this->fullPath, $this->unencryptedSize); |
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.
This line updating the ecryptionStorage should be moved to stream_close() right after $this->flush().
@jknockaert your changes are in here: b57f469 I added unit testing on top |
a3c78bf
to
e4ec4ca
Compare
@jknockaert see e4ec4ca |
@DeepDiver1975 Thanks |
I'll move this to it's own pr |
@DeepDiver1975 Ah, that's why it's gone again; I already wondered... |
@DeepDiver1975 I think this PR could be labelled for review now. @schiesbn Could you test the big file issue? I think there also needs to be done some testing with unseekable encrypted streams; I don't have such a setup here. |
@DeepDiver1975 Reviewing my own code I noticed that I forgot to initialise the protected variables I added; so could you pls add |
@jknockaert quick testing this with a big file shows that this doesn't really help yet |
The issue is within the calcs of $positionInFile .... this change doesn't seem to help |
@DeepDiver1975 Not entirely sure what's happening here. Does this only happen with big files? What is big? Bigger than 6kb? Or bigger than 6MB? I would suggest to add the initialisation commented above; on top of that I am still unsure whether |
that file has a size of 1.7MB |
@DeepDiver1975 Pls also add in |
Conflicts: lib/private/files/stream/encryption.php
I cherry-picked this state over to #14472 I tested it with some large files and it worked great here. But we should still investigate the problem at the chonk border mentioned by @DeepDiver1975 @jknockaert Thanks a lot for your contribution! There is another issue which might or might not be related to the stream wrapper. |
Conflicts: lib/private/files/stream/encryption.php
Maybe this PR should be closed now that it has been ported to #14472? |
agree |
Conflicts: lib/private/files/stream/encryption.php
Conflicts: lib/private/files/stream/encryption.php
Conflicts: lib/private/files/stream/encryption.php
Conflicts: lib/private/files/stream/encryption.php
follow up of #15303
@schiesbn @nickvergessen @jknockaert