The updater took a file and its SHA-256 from the same feed answer, so whoever could change /api/latest could swap both; only the Mac app also checked its signing team. Now release CI (yetone/magpie-releases) signs "magpie release <version>\n" + SHA256SUMS with an ed25519 key held as that repo's UPDATE_SIGNING_KEY secret and publishes SHA256SUMS.sig (release assets: 16 -> 17). The site worker carries the list and signature in the feed; internal/update/signed.go checks them against the public key built into the binary, takes each file's hash from the signed list and refuses a missing or bad signature or a feed hash that differs. Versions from 0.1.3862 require it; older ones and binaries older than the key update as before. MAGPIE_UPDATE_FEED lifts the requirement for local test servers. mirror-release waits for 17 assets; docs/reference.md and code-standards say 17 and describe the transition. Run: go test internal/update, internal/cli, internal/gui -run Update|WhatsNew (ok); node --test site/*.test.mjs (116 ok); gofmt; go vet darwin, linux nogui, windows on internal/update. Broken by hand: signature check skipped (tamper and other-key tests red), feed-hash comparison skipped (swapped hash and feed tests red), worker not attaching signed (worker test red). The embedded key is checked against a sample signed by the real key with openssl, as CI does. Signing script run against a throwaway key. Not tried: a real signed release before this tag; install.sh does not verify the signature.
2 lines
89 B
Standard ML
2 lines
89 B
Standard ML
OT7nCVnsnONdQsBC4rfHcpqouwWLfavkbv3FCdPOBjGTBdHTefDVHQdZe8w1T5nOwlvA/S5a2EiI9zC9yOOcBQ==
|