Repository navigation
feat(release): sign each archive for cargo binstall - #2765
Merged
Merged
Conversation
thiras
force-pushed
the
feat/binstall-signatures
branch
from
October 29, 2026 20:42
60d5905 to
ab12966
Compare
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Gas snapshotNo gas changes vs base. |
thiras
force-pushed
the
feat/binstall-signatures
branch
2 times, most recently
from
October 29, 2026 21:21
358996d to
0b04edf
Compare
cargo binstall reads no checksum manifest: it verifies each archive against its own minisign signature. sign-release.sh now signs every archive with the maintainer minisign key in the same minisign run as SHA256SUMS.minisig (one password prompt) and uploads <archive>.minisig beside it. The four binary crates' [package.metadata.binstall.signing] names that key, so binstall refuses an archive whose signature is missing or does not verify (a missing one falls back to a source build). sign-release.sh reads the key from the tag's manifests, which are what crates.io serves, refuses before signing when the crates disagree or name none, and refuses before uploading when an archive does not verify under it. publish-crates.sh refuses a release with an unsigned archive, since a crates.io version cannot be replaced. check-binstall-metadata.sh also holds the signing section to one shape: the same key in every crate, a key line of crates/cli/minisign-*.pub, written on the one line form sign-release.sh reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thiras
force-pushed
the
feat/binstall-signatures
branch
from
October 29, 2026 21:30
0b04edf to
3760e7c
Compare
binstall lets an override's `signing` replace the base table for that target, and nothing checked one: a Windows override naming another key would publish green and fail every Windows install for good. The guard now refuses `signing` in any override, finds `pubkey` assignments in every form (dotted, inline, quoted) across every crates/*/Cargo.toml, the set sign-release.sh's sed reads, and reads the bytes so a CRLF line fails as it does in sed. sign-release.sh verifies every minisign signature with -H: without it a legacy-format signature, which neither decdn self-update nor binstall accepts, passed. It reads the tag's keys and the archive list before the GPG step, so a key mismatch stops before either passphrase prompt, and skips blank SHA256SUMS lines. publish-crates.sh runs check_binstall_metadata.py in its worktree at the tag, since CI is not guaranteed to have run on the tagged commit, and takes the archives it requires signatures for from SHA256SUMS rather than the release listing, so a missing archive is refused too. Tests: the gh and minisign shims refuse missing signature files and model -H and legacy signatures; new cases cover a rerun with stale signatures, a legacy signer, a blank SHA256SUMS line, and publish-crates' asset checks and guard run. Docs: RELEASING.md and SECURITY.md fixes the review listed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thiras
marked this pull request as ready for review
October 29, 2026 21:41
Contributor
Author
|
Review round (code, tests, comments, silent failures), addressed in fcdaceb:
Not changed:
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Two adjacent literals in a list read like a missing comma. Each one that forms a single value now says so: an explicit `+` where it is a list element, parentheses where it is part of a tuple. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
Follows #2764, which added the binstall metadata.
cargo binstall reads no checksum manifest. It verifies each archive against its own minisign signature,
file = "{ url }.minisig". This PR makes binstall verify what it installs:[package.metadata.binstall.signing]withalgorithm = "minisign",pubkeyset to the key line ofcrates/cli/minisign-thiras.pub, andfile = "{ url }.minisig".scripts/sign-release.sh:pubkeyfrom the tag's manifests (what crates.io will serve). It refuses before the password prompt when the crates disagree or name none.SHA256SUMSand every archive in oneminisign -Srun, so there is still one password prompt. Without-x, minisign writes<file>.minisigfor each file.<archive>.minisigunder the binstall key and refuses before any upload on a mismatch.scripts/publish-crates.sh: refuses a release in which any archive has no.minisig. A crates.io version can never be replaced, so publishing without them would leave binstall building that version from source permanently.check-binstall-metadata.sh: also checks the signing section in every crate:crates/cli/minisign*.pub;algorithmandfileas above;pubkey = "<key>"line, the only form sign-release.sh'ssedreads.pubkeyfield holds one key, not a set, so it follows whoever signs. A release by another maintainer, or the first after a key rotation, changes it in all four manifests before tagging.KEYS.Reviewer notes
.minisig. binstall refuses the archive ("could not GET ….tar.gz.minisig: 404") and falls back tocargo installfrom source. It never installs an unsigned archive. Merging this before a release is signed the new way therefore degrades installs to source builds; it never installs unverified bytes.pubkeyper crate version, unlikedecdn self-update, which accepts any embedded key. With one maintainer key today this costs nothing, and the RELEASING.md section covers the hand-off.Verification
minisign -S -m SHA256SUMS a.tar.gz b.tar.gzcall the script makes, served over HTTPS (--root-certificates) and installed from a manifest carrying the signing section:Failed to verify signature, nothing installed;The signature was created with a different key than the one provided, nothing installed.scripts/tests/test_sign_release_publish.pyhas 14 passing tests (4 new). Its minisign shim now models multi-file-S, default.minisignames and-P <key>. The new tests: archives the binstall key can't verify are refused with no upload; crates naming different keys, or none, are refused before-S; the key comes from the tag's tree, not the working tree. The existing stable-release test now also asserts the single-Scall, the per-archive-V -Pcalls and the uploaded.minisignames.RWQFaucN…ESn, the key line ofminisign-thiras.pub.b-1-w.zipfor the second.uvx --with pyyaml pytest .github/scripts/tests scripts/tests: 351 passed.shellcheckis clean on both scripts.pre-commit runon the changed files passes; the cargo-deny RUSTSEC-2026-0387 finding is pre-existing and warn-only.cargo binstall --strategies crate-meta-data decdn-clion a clean machine. This is the first real signed install.Always:
pre-commit run(changed files)CARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-features(no Rust source changed; left to CI)cargo nextest run(no Rust source changed; left to CI)Only if touched:
CHANGELOG.mdentry added🤖 Generated with Claude Code