Files
w3cjandClaude Opus 5.5 77e0f94f84 feat(minisign): sign as minisign does, for the co-signer
The co-signer signs SHA256SUMS and base-index.json with a minisign key
of its own, made with no password, so it can sign unattended. This adds
that signing to internal/minisign, the one owner of devvm's signatures,
reviewable against minisign's format alone:

- SecretKey and ParseSecretKey: an unencrypted minisign -G -W key, 158
  bytes: Ed, KDF \0\0, B2, salt and limits, key ID, the 64-byte key and
  a BLAKE2b-256 checksum over the algorithm, key ID and secret key. An
  encrypted key is refused, the checksum is checked when it isn't zero,
  and the public half is derived again from the seed and compared.
- Sign: the prehashed ED signature, the global signature over the
  signature and the trusted comment, and minisign's own untrusted
  comment, the same bytes minisign -S -t writes (TestSignAsMinisign
  pins them to a signature minisign 0.12 made). Ed25519 is
  deterministic, so signing again gives the same bytes.
- Keys.CheckRole checks one role's signature, as the co-signer checks
  CI's before it rebuilds anything; LegacyComment is the old release
  key's trusted comment, devvm <version>, which upgrade/legacy.go now
  takes from here.

The zero checksum of a -W key was checked against minisign's source:
generate() zeroes the key and computes the checksum only inside
encrypt_key, which -W skips, in 0.12 and on master, and a key minisign
0.12 made with -W has 32 zero bytes there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 21:36:37 -07:00
..