Skip to content
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

Change ZipAESStream to handle reads of less data than the AES block size #331

Merged
merged 2 commits into from
Jun 15, 2019

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Mar 11, 2019

This is an attempt to handle #324 by changing ZipAESStream.Read() to buffer the transformed data in cases where the length of the data to read is less than the crypto block size (or not a multiple of the block size).
When reading full blocks, it transforms directly into the output buffer so the data doesn't need to bew copied again.

Not sure if it's best to do it like this, or to buffer the data seperately in this case?

(also, fwiw, I originally saw this issue when looking at #315 and then reproed it with Stored files, so changing this will help with that as well).

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@piksel piksel self-requested a review May 22, 2019 11:24
@piksel piksel merged commit 98bbdda into icsharpcode:master Jun 15, 2019
@Numpsy Numpsy deleted the zip_aes_store_partial_read branch June 15, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants