[PR #1011] [MERGED] Releases: signed checksums (SHA256SUMS, SHA256SUMS.sig) for game and launcher releases #2985

Closed
opened 2026-11-02 16:00:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1011
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: feat/signed-release-checksums


📝 Commits (4)

  • f32a91d Releases: signed checksums (SHA256SUMS, SHA256SUMS.sig) for game and launcher releases
  • d38c07c Releases: sign in a job of its own that runs only sha256sum and OpenSSL
  • 182a8e1 horizon-release-sign keygen: PKCS#8 v1 keys, which OpenSSL 3.0 reads
  • 76e3827 release.yml sign step: a block scalar, so the line break isn't folded into an escaped space

📊 Changes

12 files changed (+900 additions, -5 deletions)

View changed files

📝 .github/workflows/launcher.yml (+49 -2)
📝 .github/workflows/release.yml (+51 -2)
📝 Cargo.lock (+8 -0)
📝 Cargo.toml (+1 -1)
➕ crates/horizon-release-sign/Cargo.toml (+15 -0)
➕ crates/horizon-release-sign/release-keys.txt (+4 -0)
➕ crates/horizon-release-sign/src/lib.rs (+345 -0)
➕ crates/horizon-release-sign/src/main.rs (+139 -0)
➕ crates/horizon-release-sign/tests/cli.rs (+182 -0)
📝 docs/release-flow.md (+35 -0)
➕ tools/ci/new_release_key.sh (+22 -0)
➕ tools/ci/sign_release.sh (+49 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Security brief (Ludovic, 2026-10-19), item 2, first half: releases get signed. Launchers and horizon-server update checking the signature come in a follow-up pull request, merged only once signed releases exist.

What

  • crates/horizon-release-sign (lib + small CLI). SHA256SUMS uses sha256sum format. SHA256SUMS.sig holds one base64 Ed25519 signature per line over horizon release <tag>\n + SHA256SUMS. Putting the tag in the signed message means an old signed list can't be replayed under a new tag. It uses ring and base64, already in both lockfiles through rustls, so no new crypto dependency is added.
  • A sign job of its own in release.yml and launcher.yml. It is the only job with environment: release, set only for real releases from main; dry runs use an empty environment and a throwaway key. The job sparse-checks out only tools/ci/sign_release.sh, which runs the runner's sha256sum and OpenSSL and nothing else. No repository code ever runs next to the key, so a merged change to Cargo.toml (a [patch]), a build script or a step writing $GITHUB_ENV/$GITHUB_PATH can't reach it.
  • Publish (no key) checks the result exactly as launchers will: horizon-release-sign verify --publishing against the public keys built in from release-keys.txt. It then uploads SHA256SUMS and SHA256SUMS.sig.
  • Releases keep working during the transition. While release-keys.txt is empty, releases go out with SHA256SUMS alone and a ::warning::. Once the file lists a key, a missing or unknown signing key fails the release before anything is published.
  • Key rotation. The job signs with RELEASE_SIGNING_KEY and RELEASE_SIGNING_KEY_NEXT (one line each), and launchers accept any line signed by any built-in key.
  • tools/ci/new_release_key.sh (for the orchestrator or Ludovic) pipes horizon-release-sign keygen straight into gh secret set RELEASE_SIGNING_KEY --env release. The key never touches disk, a log or the vault, and keygen refuses to write to a terminal. Only the public key is printed.
  • docs/release-flow.md: "Signed checksums", with the rotation plan.

How tested

  • cargo test -p horizon-release-sign: 10 tests, all passing:
    • Lib: round trip; refusal of another tag, a changed checksum, another key, no signature, no keys and an unlisted asset; two-key rotation; both sha256sum line forms; the secret is never echoed in errors.
    • CLI: tools/ci/sign_release.sh run with real OpenSSL 3, ephemeral and with two keygen-made secrets, checked by verify (each key alone passes, a third key fails, no secret is printed). A tampered archive is refused. The transition rules hold. keygen writes into a pipe.
    • OpenSSL 3 reads ring's PKCS#8 v2 keys: checked locally, and the public keys match.
  • cargo clippy -p horizon-release-sign --all-targets -- -D warnings, cargo fmt --all --check, tools/check_public_tree.py, actionlint (no new findings), shellcheck on both scripts.
  • Dry runs on this branch (workflow_dispatch, nothing published). The first design passed: release run 39249080662 and launcher run 39249084619, which also proves environment: '' works in dry runs. The sign-job design is release run 39251093949 and launcher run 39251099324, with results in a comment below.

Order / needs the orchestrator

  1. Create the release environment: deployment branches main only, no required reviewers, so releases stay automatic.
  2. Run tools/ci/new_release_key.sh once with the maintainer's gh login. Then add the printed public key to crates/horizon-release-sign/release-keys.txt in a one-line pull request.
  3. Merge the launcher/server verification pull request only after a signed release exists.

Label skip-release: nothing player-facing changes.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1011 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/signed-release-checksums` --- ### 📝 Commits (4) - [`f32a91d`](https://github.com/horizon-rust/horizon/commit/f32a91d7939688b135e43b28d13f714d77a7ceeb) Releases: signed checksums (SHA256SUMS, SHA256SUMS.sig) for game and launcher releases - [`d38c07c`](https://github.com/horizon-rust/horizon/commit/d38c07c2fa6b6a814ff5312c6a570685ab7cac2a) Releases: sign in a job of its own that runs only sha256sum and OpenSSL - [`182a8e1`](https://github.com/horizon-rust/horizon/commit/182a8e1a152a8d3cb5c95e387d7685df38677840) horizon-release-sign keygen: PKCS#8 v1 keys, which OpenSSL 3.0 reads - [`76e3827`](https://github.com/horizon-rust/horizon/commit/76e3827545ae17454f0d5a2edc49be08a27245f9) release.yml sign step: a block scalar, so the line break isn't folded into an escaped space ### 📊 Changes **12 files changed** (+900 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+49 -2) 📝 `.github/workflows/release.yml` (+51 -2) 📝 `Cargo.lock` (+8 -0) 📝 `Cargo.toml` (+1 -1) ➕ `crates/horizon-release-sign/Cargo.toml` (+15 -0) ➕ `crates/horizon-release-sign/release-keys.txt` (+4 -0) ➕ `crates/horizon-release-sign/src/lib.rs` (+345 -0) ➕ `crates/horizon-release-sign/src/main.rs` (+139 -0) ➕ `crates/horizon-release-sign/tests/cli.rs` (+182 -0) 📝 `docs/release-flow.md` (+35 -0) ➕ `tools/ci/new_release_key.sh` (+22 -0) ➕ `tools/ci/sign_release.sh` (+49 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Security brief (Ludovic, 2026-10-19), item 2, first half: releases get signed. Launchers and `horizon-server update` checking the signature come in a follow-up pull request, merged only once signed releases exist. ## What - **`crates/horizon-release-sign`** (lib + small CLI). `SHA256SUMS` uses `sha256sum` format. `SHA256SUMS.sig` holds one base64 Ed25519 signature per line over `horizon release <tag>\n` + SHA256SUMS. Putting the tag in the signed message means an old signed list can't be replayed under a new tag. It uses `ring` and `base64`, already in both lockfiles through rustls, so no new crypto dependency is added. - **A `sign` job of its own** in release.yml and launcher.yml. It is the only job with `environment: release`, set only for real releases from main; dry runs use an empty environment and a throwaway key. The job sparse-checks out only `tools/ci/sign_release.sh`, which runs the runner's `sha256sum` and OpenSSL and nothing else. **No repository code ever runs next to the key**, so a merged change to Cargo.toml (a `[patch]`), a build script or a step writing `$GITHUB_ENV`/`$GITHUB_PATH` can't reach it. - **Publish** (no key) checks the result exactly as launchers will: `horizon-release-sign verify --publishing` against the public keys built in from `release-keys.txt`. It then uploads `SHA256SUMS` and `SHA256SUMS.sig`. - **Releases keep working during the transition.** While `release-keys.txt` is empty, releases go out with `SHA256SUMS` alone and a `::warning::`. Once the file lists a key, a missing or unknown signing key fails the release before anything is published. - **Key rotation.** The job signs with `RELEASE_SIGNING_KEY` and `RELEASE_SIGNING_KEY_NEXT` (one line each), and launchers accept any line signed by any built-in key. - **`tools/ci/new_release_key.sh`** (for the orchestrator or Ludovic) pipes `horizon-release-sign keygen` straight into `gh secret set RELEASE_SIGNING_KEY --env release`. The key never touches disk, a log or the vault, and `keygen` refuses to write to a terminal. Only the public key is printed. - docs/release-flow.md: "Signed checksums", with the rotation plan. ## How tested - `cargo test -p horizon-release-sign`: 10 tests, all passing: - Lib: round trip; refusal of another tag, a changed checksum, another key, no signature, no keys and an unlisted asset; two-key rotation; both `sha256sum` line forms; the secret is never echoed in errors. - CLI: **`tools/ci/sign_release.sh` run with real OpenSSL 3**, ephemeral and with two keygen-made secrets, checked by `verify` (each key alone passes, a third key fails, no secret is printed). A tampered archive is refused. The transition rules hold. keygen writes into a pipe. - OpenSSL 3 reads ring's PKCS#8 v2 keys: checked locally, and the public keys match. - `cargo clippy -p horizon-release-sign --all-targets -- -D warnings`, `cargo fmt --all --check`, `tools/check_public_tree.py`, `actionlint` (no new findings), `shellcheck` on both scripts. - Dry runs on this branch (workflow_dispatch, nothing published). The first design passed: release run 39249080662 and launcher run 39249084619, which also proves `environment: ''` works in dry runs. The sign-job design is release run 39251093949 and launcher run 39251099324, with results in a comment below. ## Order / needs the orchestrator 1. Create the `release` environment: deployment branches `main` only, **no** required reviewers, so releases stay automatic. 2. Run `tools/ci/new_release_key.sh` once with the maintainer's gh login. Then add the printed public key to `crates/horizon-release-sign/release-keys.txt` in a one-line pull request. 3. Merge the launcher/server verification pull request only after a signed release exists. Label `skip-release`: nothing player-facing changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2985
No description provided.