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

Feature/password protected zip #79

Merged
merged 14 commits into from
Sep 29, 2024

Conversation

itsrobli
Copy link
Contributor

Fixes #62

Ability to unzip password protected zips. As discussed in #62

  • Tests pass
  • Appropriate changes to README are included in PR

Copy link

google-cla bot commented Sep 28, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@itsrobli itsrobli marked this pull request as ready for review September 28, 2024 05:30
Copy link
Collaborator

@adetaylor adetaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've requested a couple of small changes but basically looking good. Thanks for working on this!

src/unzip/mod.rs Outdated Show resolved Hide resolved
src/unzip/mod.rs Show resolved Hide resolved
@itsrobli itsrobli requested a review from adetaylor September 28, 2024 12:08
src/main.rs Outdated
@@ -73,6 +73,11 @@ struct UnzipArgs {
#[arg(short = 'd', long, value_name = "DIRECTORY")]
output_directory: Option<PathBuf>,

/// Password to decrypt encrypted zipfile entries (if any).
/// Encryption is assumed to be the ZipCrypto algorithm.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this sentence is correct? It looks to me as though the underlying library supports either ZipCrypto or AES encryption.

I'm wondering about the pros and cons of adding a test for AES encryption too. Pros: thoroughness. Cons: it's really a test of the underlying library, not ripunzip, and it might require enabling additional features in it.

Overall, if you've any doubt about whether AES is supported, please add a test! Otherwise, don't bother - but please clarify this doc comment either way.

Sorry for not spotting this on the first pass.

Copy link
Contributor Author

@itsrobli itsrobli Sep 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, this was a good pickup. Thank you.

I've clarified the doc comment.

I've opted not to add a test for AES encrypted zipfiles because v0.6.3 of the zip library (current version used) doesn't seem to have an easy interface to do this (compared to the newer v2.2). I also didn't want to include a pre-made zip file because it's a bit suspicious finding a random zip file in source code.

I have tested it separately though - i.e. using the binary on a aes encrypted zipfile - yes it does work.

@itsrobli itsrobli requested a review from adetaylor September 28, 2024 16:34
@adetaylor
Copy link
Collaborator

Thanks - merging! I'll make a new release sometime in the next few days.

@adetaylor adetaylor merged commit d08fabc into google:main Sep 29, 2024
11 checks passed
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.

Option to unzip password protected file - code diff included
2 participants