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
Assignees
Projects

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 srikanth-lingala self-assigned this Nov 6, 2021
@srikanth-lingala srikanth-lingala added this to To do in Zip4j via automation Nov 6, 2021
@srikanth-lingala srikanth-lingala moved this from To do to In progress in Zip4j Nov 6, 2021
@srikanth-lingala srikanth-lingala moved this from In progress to Review in Zip4j Nov 6, 2021
@srikanth-lingala
Copy link
Owner

Fixed in v2.9.1 released today.

Zip4j automation moved this from Review to Done Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Zip4j
  
Done
Development

No branches or pull requests

2 participants