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

Make PutNextEntry throw if the entry is AES and no password has been set. #509

Merged
merged 1 commit into from
Oct 17, 2020

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Aug 17, 2020

refs #507 - possible simple way to avoid the issue, by making PutNextEntry throw if the new entry has an AESKeySize set and the stream password hasn't been set.

I made it an InvalidOperationException rather than an ArgumentException with the idea that the operation is invalid when the stream has no password,

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.

Yeah, the argument isn't actually the problem, but rather the state of the ZipOutputStream (even though you could argue that the AESKeySize of the argument is the issue, but I think that's less helpful).

@piksel piksel merged commit 9e02750 into icsharpcode:master Oct 17, 2020
@Numpsy Numpsy deleted the rw/zos/throw_if_no_password branch October 20, 2020 21:26
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.

2 participants