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

Digest exception when using a protected zip file (with password) in the application package #276

Open
serge-xav opened this issue Mar 5, 2024 · 5 comments

Comments

@serge-xav
Copy link

serge-xav commented Mar 5, 2024

If I add a password protected zip file in the application package, I get the following error with version 1.8.6 :

Exception in thread "main" java.io.IOException: Error computing digest for: externalProperties.zip
	at com.threerings.getdown.data.f.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.zip.ZipException: invalid CEN header (encrypted entry)
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:225)
	at java.util.zip.ZipFile.<init>(ZipFile.java:155)
	at java.util.zip.ZipFile.<init>(ZipFile.java:169)
	at com.threerings.getdown.data.Resource.computeDigest(Unknown Source)

The error is not present in version 1.7.X
I think the cause is the pull request #206 (comment)

I'm wondering if usage of zip files as resource, should be configurable, using a switch in getdown.txt file ? This would also close #275

@bekoenig
Copy link
Contributor

bekoenig commented Mar 12, 2024

Hi @serge-xav,

in my opinion computing zip file digest in a robust way is an important improvement. So #275 is the implication of a change to an unsafe implementation.

For your mentioned bug here, the best solution would be a fallback to the default digest calculcation, when the zip file is encrypted.

Another solution would be to change the extension to ".zip.dat", so getdown don't tries to open the file.

@serge-xav
Copy link
Author

Hi @bekoenig, thanks for your comment.
I will try to implement your workaround for encrypted zip files. If a correction is needed on Getdown side, do you know when/how the new digest calculation has been implemented for zip files ? I tried to take a look at it, but I don't know how to implement the "fallback to default digest calculation when zip file is encrypted"

@bekoenig
Copy link
Contributor

In the next weeks getdown 2.0.0 will be released with different group-id (see bekoenig/getdown#1). This version is feature complete and waits for final release. After this, I can implement this fallback in

and check for openable.

@serge-xav
Copy link
Author

Hi again Benjamin, I did not see this announcment before, that's good news to see Getdown up and living. Do you want me to also create the issue on your project ?

@bekoenig
Copy link
Contributor

bekoenig commented Mar 12, 2024

You are welcome to open a new issue in my repository. I will try to fix it in the next month.

After the first release I will open a new issue here to mark this repository as deprecated and link to my fork. I'm new to github and opensource contribution, so I need time to adapt my wellknown processes.

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