test(builder): a full download whose bytes are not the signed ones is refused #3009
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3009
Loading…
Reference in a new issue
No description provided.
Delete branch "PedroRossi/Longshot:test/release-download-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Nothing fails if the release download's hash check breaks.
download_checked(
builder/crates/release/src/install.rs) is the last check before a downloaded file is installed: it compares thefile's size and SHA-256 with the release's signed list. The signature covers that list, not the files, so this
comparison is what makes a signed release mean that the bytes a player installs are the ones published; a damaged
download, or bytes changed by a cache or a mirror on the way, is refused only here.
No test catches it broken: on main @
1938a302, withsha == sha256taken out of that comparison, all 32 of the releasecrate's tests still pass. A refactor that drops it, or a size-only check, would ship unnoticed.
This adds
a_full_file_whose_bytes_are_not_the_signed_ones_is_refused(release/src/install/tests.rs): a file of theright size with one byte changed, which only the hash refuses. It fails with the comparison removed. A test only.
Testing
Tested: on this PC (Linux): the new test passes; it fails with the SHA-256 comparison removed, and the
release crate's 32 tests on main pass with it removed. The release crate's tests, clippy -D warnings, rustfmt. As
pr createasks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @1938a302with #3009, #3011 and #3012 merged, through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game.mise run test(--strict) on main @1938a302, and on main with this change merged (together with #3010, #3011, #3012, #3013, #3014, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none fails only with it. The 145 are named at the end.Still to test:
None: a test of the builder's code, run here.
Measurements
Nothing to measure: a test; nothing a build, the builder or the game runs changes.
Risks
None: a test.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.The 145 checks of
mise run testthat fail on main @1938a302on this PC too, with or without this change97 need a tool this PC doesn't have on PATH (
--strictfails them):48 fail on main itself: test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_framegen_resources.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_input_background.py, test_keyboard_option.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_oot_occ_raster.py, test_option_ids.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recording_admission.py, test_screensaver.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_upscaler_round_trip.py, test_vram_compact.py, test_windows_display_startup.py, test_windows_on_linux.py
Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them.
Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code
Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @
1938a302with this change merged (and my two other release-crate pull requests), through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The release crate's code runs when a version is fetched or installed, not in a build or the game.WIP: test(builder): a full download whose bytes are not the signed ones is refusedto test(builder): a full download whose bytes are not the signed ones is refused@review
Recommendation: Approve. The test exercises a same-size corrupted download and the reported mutation run shows it catches removal of the hash comparison. CI is still running and must pass before merge. Nothing blocking is left. Recommend approval; not approved on the forge.
Adds a regression test for rejecting altered release bytes before installation. It improves coverage without changing player-facing code.
Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports that the new test passes normally and fails when the SHA-256 comparison is removed; all 32 existing release-crate tests passed with that comparison removed.
Other systems: The test uses an in-memory forge and the Linux platform key on both host platforms. It changes no builder or game runtime behavior.
Switches: None.
Reviewed:
c3b35486b0against1938a302fe: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the commit, the complete diff, install/tests.rs, install.rs and forge.rs. Read the scratch and hashing helpers in lib.rs. docs/review-checklist.md and the neighboring Tooling checkout were absent. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no commands from the project or tests were run. The author reports Linux test, mutation, clippy and rustfmt results. CI is still running.
Overlaps and merge order: None found in the supplied material; the other audit pull requests are reported as tested together, but their diffs were not supplied.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.