Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not set the StrongEncryption flag for WinZipAes encrypted entries #329

Merged
merged 1 commit into from
Jun 15, 2019

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Mar 4, 2019

Change ZipEntry.ProcessAESExtraData to not set the StrongEncryption flag for WinZipAes encrypted entries.

As mentioned in #317, setting the StrongEncryption flag in ProcessAESExtraData doesn't seem correct.
This changes that, and rearranges CreateAndInitDecryptionStream to check for the compression method being WinZipAES rather than for the StrongEncryption flag being set.
This will throw if the archive is really using the PKWare strong encryption, which I think is correct if that isn't actually supported?

Related to this: I'm not sure if the

versionToExtract = ZipConstants.VERSION_AES

in ProcessAESExtraData is correct either (what happens if the existing version is greater than that?). Maybe needs a seperate change?

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.

Copy link
Member

@piksel piksel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will stop us from writing incorrect headers, whilst still allowing older (incorrect) files to be read as long as they specify the correct CompressionMethod. Nice!

@piksel piksel changed the title Change ZipEntry.ProcessAESExtraData to not set the StrongEncryption f… Do not set the StrongEncryption flag for WinZipAes encrypted entries Jun 15, 2019
@piksel piksel merged commit 5cca93d into icsharpcode:master Jun 15, 2019
@Numpsy Numpsy deleted the strong_encrypt_flag branch June 16, 2019 08:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants