Repository navigation
extract::Options::encrypted_links: Verify / VerifyFirst (UnRAR order) / PlaceUnverified (7-Zip x) for encrypted RAR5 links - #320
Conversation
…AR5 links without checking the password (7-Zip's x) #307 made every route place (or pass in a test) an encrypted RAR 5.0 redirection only when its password check value verifies the password, as UnRAR does. 7-Zip 26.06 `x` places such links under a wrong password, with none, and with no check value (exit 0, "Everything is Ok"), and Prybar's 7z mode needs that. New `extract::Options::encrypted_links: EncryptedLinks` (`Verify`, the default and #307's behaviour, or `PlaceUnverified`), mirrored for RarSession test runs by `RarSessionOptions::encrypted_links`. With `PlaceUnverified` the password gate is skipped for RAR5 redirections (no key derived) on extract::run*, RarSession extract_selected / extract_selected_controlled / test_selected, and progressive sessions; the link is reported as any placed link (RarOutcome::Verified) with the new evidence RarPasswordEvidence::Unverified. Every other link check (escaping targets, hard-link sources, protected paths, overwrite decisions) still applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…cked before the overwrite and target decisions (UnRAR's order) For Prybar's unrar mode: `unrar x -o- -pwrong` over links that already exist reports "Incorrect password" (exit 11) where Verify skipped the existing target, and a hard link with a missing target is reported as the wrong password where Verify reported the target. VerifyFirst fails such a member as WrongPassword / PasswordRequired / EncryptedIntegrity(UnverifiableLinkPassword) before those decisions on the whole-archive runner, RarSession extraction (and the controlled route) and progressive sessions; a verified password goes on to them as usual. Nothing is placed either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
…c examples) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42c9c62b40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…derives the key once; unchecked link checksums are passed over at the final verdict too - VerifyFirst's early check keeps the evidence, and the link's data-less member machine then runs without its cipher, so the KDF isn't run (and charged to KdfSessionBlocks) a second time. - PlaceUnverified (and VerifyFirst) clear the part's final checks as well as the machine's, so a link carrying a keyed CRC32 or a BLAKE2sp hash isn't failed (DeclaredHashUnavailable) at the verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Local CI (rustyget-x86-a) on the exact head 092827a: fmt, clippy (plain and persistent-partials), workspace tests (plain 288s, persistent-partials 364s) and doctests (both) passed. |
Restores 7-Zip's behaviour for encrypted RAR 5.0 link members as an opt-in, for Prybar's 7z compat mode (regressed by #307).
API (for Prybar)
Prybar:
VerifyFirstin unrar mode,PlaceUnverifiedin 7z mode,Verifyelsewhere. For 7z mode setOptions { encrypted_links: EncryptedLinks::PlaceUnverified, .. }(andRarSessionOptions { encrypted_links: EncryptedLinks::PlaceUnverified, .. }if it tests through RarSession).Existing literals: add
encrypted_links: Default::default().With
PlaceUnverified, an encrypted RAR5 symlink / junction / hard link / file copy is placed (or passes a test) with awrong password, with no password, and with no usable check value. No key is derived. The member is reported like any
placed link,
RarOutcome::Verified, and itschecks.passwordisRarPasswordEvidence::Unverified(even when the passwordwas right, because it isn't checked). Progressive sessions report
MemberOutcome::Verified/Tested, which carries nopassword evidence.
All other link-safety checks still apply: targets that escape the destination (
refusal_before_place), hard links or copiesof files this run didn't extract, protected paths,
replace_placed_links, and overwrite decisions. RAR 4.x symlinks andmembers with data still need their password.
VerifyFirst (requested by Prybar for unrar mode)
UnRAR checks an encrypted link's password before anything else.
unrar x -o- -pwrongover links that already exist prints"Incorrect password" and exits 11. A hard link whose target is missing is reported as a wrong password. Under
VerifyFirst, apassword that doesn't verify fails the member as
WrongPassword/PasswordRequired/EncryptedIntegrity(UnverifiableLinkPassword)before the overwrite decision and the link-target checks. On a progressivesession, the session stops with that failure. A password that verifies goes on to the usual skip and target decisions.
Nothing is placed either way. Older revisions are still skipped first.
RarSession::test_selectedalready checked thepassword first.
Routes covered
extract::run,run_with_password,run_rar_with_outcomesand the checked dispatchers. This includes the early"no password" refusal, which now lets such a link through to the link code.
RarSession::extract_selectedandextract_selected_controlledreadOptions::encrypted_links.test_selected(test_link) readsRarSessionOptions::encrypted_links.ProgressiveOptions.extract.encrypted_links. There is no unverifiable-link refusal, and thedata-less link machine runs without the cipher or the empty-data checksum.
7-Zip 26.06 finding (7zz, macOS arm64, on this PR's test archives)
x -p<wrong>x(no -p)t -p<wrong>../outsideSo for
x/e, 7-Zip reports no error while creating the link. No error signal is needed, andPlaceUnverifiedreports itas Verified.
RarPasswordEvidence::Unverifiedis still exposed so a caller can tell an unchecked link apart.7z tdoescheck a check value that is present; this option does not mirror that, and passes such links in a test too.
Tests (tests/rar5_link_password.rs)
Verify): the existing RAR5: encrypted link members are placed only when the password verifies (as UnRAR; was created under a wrong -p) #307 tests.place_unverified_places_encrypted_links_on_the_whole_archive_runnerplace_unverified_places_encrypted_links_on_a_rar_session(extract and test)place_unverified_places_encrypted_links_on_the_controlled_routeplace_unverified_places_encrypted_links_on_a_progressive_session(extract and test)a_link_placed_unverified_reports_unverified_evidenceplace_unverified_still_refuses_a_link_that_escapes(every route)place_unverified_places_encrypted_hard_links_and_copies(including a hard link to a missing source, which is still refused)verify_first_reports_a_wrong_password_before_skipping_an_existing_target: case 1, Verify vs VerifyFirst, on therunner, RarSession and progressive. Also covers the right password (still skipped) and no check value.
verify_first_reports_a_wrong_password_before_a_missing_hard_link_target: case 2, Verify vs VerifyFirst, with a wrongpassword, no password and the right password (still refused on the target).
Each covers a wrong password, no password, and no check value with the right and a wrong password. Revert check: with the
bypass disabled in
link::rar5_link_password, the runner's early refusal and the progressive session, all 7 PlaceUnverified testsfail and the 15 existing tests pass. With the three VerifyFirst branches disabled, both VerifyFirst tests fail.
Clean-room: written from the RAR5 format notes and 7-Zip's observed behaviour only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj