Repository navigation
fix: make the installers refuse unverified binaries - #107
Merged
Merged
Conversation
install.sh installed without a check when SHA256SUMS.txt could not be downloaded, and install.ps1 only warned, even on a checksum mismatch. Both now stop unless the binary matches its entry in the release's SHA256SUMS.txt. Closes #106
9 tasks done
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.
Closes #106
Problem
install.sh: whenSHA256SUMS.txtcould not be downloaded it printed "skipping verification" and installed anyway.install.ps1: the whole check sat in atrywhosecatchonly wrote a warning, so even a checksum mismatch installed the binary. A sums file without an entry for the binary also passed ($expectedwas empty).Change
Both installers now fail closed. They stop with an error if the sums file cannot be fetched, has no entry for the binary, or the hash does not match. README and RELEASE.md say so, and a patch changeset is included.
Verification
install.shend to end: installed v1.3.0 into a scratch directory, andglance --versionprintsSeamless Glance v1.3.0.install.shwith the checksum URL pointed at a missing file, a wrong hash, and a sums file with no entry for the binary: each one stops with an error and installs nothing.install.ps1(pwsh 7.4 in Docker, no Windows host here): the script parses, and the new verification block, run against good, wrong-hash, no-entry and missing sums files, proceeds only for the good one. The download and install steps were not exercised on Windows.No Rust changes, so no cargo checks were run.