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

Can we create a new exception type when Password is Null/Missing? #380

Closed
lakshans opened this issue Nov 4, 2021 · 3 comments
Closed

Can we create a new exception type when Password is Null/Missing? #380

lakshans opened this issue Nov 4, 2021 · 3 comments

Comments

@lakshans
Copy link

lakshans commented Nov 4, 2021

Currently, when a password is null or empty, the following is thrown:

throw new ZipException("empty or null password provided for AES decryption");

Other exceptions have a type associated except for this one. It would be useful to have a "PASSWORD_EMPTY" zip exception type, or something along those lines.

@srikanth-lingala
Copy link
Owner

Sure. I will add it.

@srikanth-lingala
Copy link
Owner

Actually, after analysing the code, I will reuse the WRONG_PASSWORD type for this case as well. ZipStandardDecrypter throws this type of exception when the password is empty. Doing the same for AesDecrypter will keep this behaviour consistent.

@srikanth-lingala
Copy link
Owner

Fixed in v2.9.1 released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants