Fixed decrypted_io to only perform integrity once#665
Closed
ListlessPanda wants to merge 2 commits into
Closed
Conversation
Member
|
Hi @ListlessPanda, Thanks for this. I'll have a look in more detail over the next couple of days. Don't worry about the failing linter; it's just a bit of trailing whitespace which I can fix easily enough. |
Member
|
Hi @ListlessPanda, Thanks, I've now merged this minus the changes related to returning empty strings. It may well be that your changes were correct, but they may also have caused backwards-incompatibility at this stage. I will fix all these issues in the next major version. Will release this code soon, thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If read is called on an entry where the Zip::DecryptedIo::CHUNK_SIZE will reach the end (thus input_finished?) but maxlen limits the output we will still do the integrity check on any follow up read which will then cause the integrity check to read 10 bytes further and cause an integrity error.
I added a change so that if the integrity check has already been done (meaning we have reached the end) it won't run again on buffer reads,