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

Recognize protected zip file #12

Closed
mooseDev opened this issue Dec 18, 2012 · 1 comment
Closed

Recognize protected zip file #12

mooseDev opened this issue Dec 18, 2012 · 1 comment

Comments

@mooseDev
Copy link

How to recognize protected zip files to present textfield for user input?
Currently one only gets an general error while unzipping and it's impossible to determine that it's because the zip file was protected....

@mattconnolly
Copy link
Owner

From stepping through the code, I can see that:

  1. Password protected zip files can be opened and their contents listed without a password.
  2. An error occurs only if the password is incorrect at the time the file contents are actually extracted.

The internal error code is a "Data error" which is overridden by the minizip library when it returns to ZipArchive. So there's no definitive way to know if the error is a wrong password or a corrupt zip file (what I would call a data error).

I'm not an export in Zip files or the minizip or zlib code. I made this fork to extend the Objective C front end to it. So I would check if you can list the contents and see if it fails to extract, ask the user for a password, then try again.

(Apologies for the delayed response, this fell off my radar for quite a while).

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

No branches or pull requests

2 participants