Skip to content

Conversation

@jeffhandley
Copy link
Member

@jeffhandley jeffhandley commented May 21, 2022

In preparation for a PR that implements dotnet/runtime#68897, adding an ZipArchiveEntry.IsEncrypted property, this PR adds 3 zip files for testing.

  • encrypted_entries_weak.zip includes 2 entries with "weak" (ZipCrypto) encryption and 2 entries that are unencrypted
  • encrypted_entries_aes256.zip includes 2 entries with "strong" (AES-256) encryption and 2 entries that are unencrypted
  • encrypted_entries_mixed.zip includes 1 entry with "weak", 1 entry with "strong", and 2 entries with no encryption

For each encrypted entry, there is a comment on the entry indicating what the password for that entry is. Each file contains a small amount of content, with simply FileName: <filename-without-ext>.

@jeffhandley jeffhandley requested a review from jozkee May 21, 2022 00:24
@jeffhandley jeffhandley enabled auto-merge (squash) May 21, 2022 00:32
@jozkee
Copy link
Member

jozkee commented May 24, 2022

  1. I see the entries are blank, which is OK for ZipArchiveEntry.IsEncrypted, but if the files were not empty, we could re-use the assets for the tests of the rest of the Zip entryption APIs (check the contents are correctly preserved/not garbled).
  2. encrypted_entries_mixed.zip doesn't have the password in the Comment.
    image

@jeffhandley jeffhandley force-pushed the jeffhandley/zippassword branch from e58779b to 0a8df49 Compare May 29, 2022 00:37
@jeffhandley
Copy link
Member Author

@jozkee Thanks for the feedback on this. I updated the zips to:

  1. Put contents into each file (simply Filename: <filename-without-extension>)
  2. Rename the "strong" file to "aes256" in case we want to extend the coverage later
  3. Ensure all encrypted files have comments with their passwords (and changed the "mixed" passwords to be different between encrypted entries)

@jeffhandley
Copy link
Member Author

Here's the branch where the feature is implemented and the tests can be seen:
https://github.com/dotnet/runtime/compare/main...jeffhandley:jeffhandley/zippassword?expand=1

@jeffhandley jeffhandley merged commit 0920468 into dotnet:main May 31, 2022
Copy link
Member

@jozkee jozkee left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

2 participants