Add archive-level password protection flags for 7z and rar#1060
Merged
adamhathcock merged 4 commits intoadamhathcock:masterfrom Dec 3, 2025
Merged
Add archive-level password protection flags for 7z and rar#1060adamhathcock merged 4 commits intoadamhathcock:masterfrom
adamhathcock merged 4 commits intoadamhathcock:masterfrom
Conversation
adamhathcock
approved these changes
Dec 3, 2025
Owner
adamhathcock
left a comment
There was a problem hiding this comment.
Looks simple and can be built upon, thanks!
Owner
|
looks like you need to run |
Contributor
Author
|
Ran csharpier on all changed files, let me know if I missed anything |
This was referenced Jan 5, 2026
This was referenced Jan 12, 2026
This was referenced Jan 19, 2026
This was referenced Jan 19, 2026
This was referenced Feb 2, 2026
This was referenced Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an encrypted flag for 7z archives and rar archives. The main reason/utility of this PR is because ExtractAllEntries is (practically) needed for solid 7z and rar archives, but an exception will be thrown if any of the files are password protected. This avoids the current requirement to pre-iterate through file entries to check for password protection.
This implementation mainly copies the logic for 7z's IsEncrypted flag. It checks the first file in the archive and checks whether it's encrypted. While it's technically possible that some later files aren't encrypted; as mentioned previously, the main utility of this flag is so that the aforementioned additional logic can be avoided for solid archives.
This also lines up with #203 (comment) , where it was suggested that the most reliable way to check for password protection is to check the entry anyways.