Verify GPG signatures against per-project trusted signers - #414
Merged
Conversation
ToolsGPGVerifyFileView now checks not just that a signature is cryptographically valid but who made it. Filenames are matched to projects and signer fingerprints to expected keys via the new gpg_trusted_projects module; a valid signature from a key not associated with the file's project (or an untracked key for a known project) raises a blocking warning before the success screen, which now shows the project name and full 40-char fingerprint(s). Multi-signature files pass if any signer is trusted. Detached signatures may use .sig or .asc; clearsigned files verify directly. Key bundle: add Specter Signer 2026, Electrum felixb_f321x and svanstaa (from published release signature key IDs); remove stale Tails key (missing the EdDSA subkey current signatures use) and duplicate BitcoinCore Matthew Zipkin entry. Add docs/gpg_trusted_signers.md with per-project websites, artifact naming, signers, and evidence; cross-link from gpg_tools.md and README.
os.listdir order is filesystem-dependent; on Linux/macOS CI the data file was not first in the listing, so select_index=0 picked the .asc signature instead of the data file. Select by button label (order-independent) and add a regression test that forces signatures-first ordering.
test_diy_mount_status.py imported the shared test bootstrap as 'tests.base' (namespace-package form) instead of 'base'. That is a different module identity for the same file, so base.py executed twice in one process and reinstalled fresh MagicMocks into sys.modules on the second pass. Modules already imported (tools_screens, screen, keyboard...) kept constants from the first mock while later imports got the second's, breaking HardwareButtonsConstants identity checks: test_tools_screens button-hold tests failed only in full-suite context (and thus on CI), passing when run alone.
Audit of current releases (Aug 2026) found gaps in the trusted-signer list: - Bitcoin Core v31.1 SHA256SUMS is signed by five keys not previously bundled: fanquake's second key, hebasto, benthecarman, marleo, and Sjors Provoost. Fetch each from a public keyserver with fingerprint verification. - GnuPG 2.4.x/2.5.x releases are signed by Werner Koch and Niibe Yutaka; both keys were already bundled in GNUPG_ReleaseKeys.asc but missing from the whitelist, so every recent release triggered unknown-key warnings. Docs: fix stale release URLs (Krux -> selfcustody/krux, Coldcard -> coldcard.com/downloads + clearsigned signatures.txt, Specter -> cryptoadvance org, Electrum -> download.electrum.org, Sparrow -> sparrowwallet/sparrow), document Krux's non-OpenPGP .sig limitation and Casa's pre-window signer. Tests: session-scoped conftest fixture fails the run if tests/base.py is ever imported under two module identities (the double-import bug that broke test_tools_screens in full-suite CI runs); whitelist tests cover the seven new fingerprints and assert the new key files are bundled.
Gpg4Win installers and source archives (gpg4win-*) have been signed by the official GnuPG release keys since 2021 (verified: gpg4win-5.1.0.exe.sig is signed by Werner Koch's dist-signing key, already whitelisted). Add a ^gpg4win- filename pattern to the GnuPG project so Verify Signature attributes them correctly instead of showing a neutral unknown-project result.
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 changed
ToolsGPGVerifyFileView now checks not just that a signature is cryptographically valid, but who made it:
src/seedsigner/models/gpg_trusted_projects.pymaps filenames to projects and primary-key fingerprints to expected signers (13 tracked projects).I Understand) before the success screen.SHA256SUMSthat can't be attributed) are shown neutrally — fingerprints only, no trust judgment..sigor.asc(both paired;.sigpreferred); clearsigned files (e.g. COLDCARD'ssignatures.txt) verify directly. Verification now parsesgpg --status-fd=1output for robust signer extraction.Key bundle:
Docs: new
docs/gpg_trusted_signers.mdwith per-project websites, artifact naming/signature formats, signer tables, and evidence; cross-linked fromgpg_tools.mdand README. AGENTS.md gains a module↔docs consistency rule.Tests
test_tools_screens.pybutton-hold timing) reproduce identically on the unmodified tree, i.e. pre-existing and unrelated.