Skip to content

feat: minisign verification, redact package, fuzzing and demo - #18

Merged
dgrieser merged 10 commits into
mainfrom
feat/signatures-redact-fuzz
Nov 17, 2026
Merged

dgrieser merged 10 commits into
mainfrom
feat/signatures-redact-fuzz

Conversation

@dgrieser

@dgrieser dgrieser commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What does this change?

  • selfupdate: an Updater with a Verifier installs nothing unless the checksums file carries a valid signature. NewMinisign(keys...) verifies minisign signatures (pre-hashed and legacy), trusts several keys for rotation, and requires the signed trusted comment. The package docs show the GoReleaser signs entry.
  • redact (new package): Values, Patterns and Marker move out of secret and use the standard library only, so logx no longer pulls in go-keyring and dbus. secret.Redact, secret.RedactPatterns and secret.Redacted stay as deprecated forwards.
  • Fix: redact.Patterns took quadratic time (about 3.5 s for 100 KB of repeated labels), which could freeze a --verbose run that logs a large response. One regex is now anchored, which makes it about 100 times faster. The fuzzer found this.
  • theme: Theme.Hashed returns the zero style where the theme is Plain, so th := theme.Active().For(w) covers name colors too.
  • Fuzz targets for redaction, ParseStyle, iCalendar folding and escaping, truncation, PlainLine, version ordering, archive extraction, minisign verification and checksums. make fuzz runs them all.
  • Coverage: secret goes from 86% to 98%, selfupdate from 91% to 98%. Only tests are added.
  • Demo program in examples/demo (make demo ARGS=pick).
  • Refactor: pick/list.go and secret/resolve.go are split into smaller files. No behavior changes.
  • Chore: adds CODEOWNERS and pins govulncheck to v1.9.0.

Breaking change

format.WriteYAML now writes a top-level list at the first column (- name: api) instead of indented by two spaces. Snapshot tests of -o yaml output in downstream tools will need new expectations. No other API breaks.

New dependency

golang.org/x/crypto (BLAKE2b, for pre-hashed minisign signatures). Only selfupdate imports it.

Interoperability

Besides the signer written from the minisign spec, the verifier is tested against a key and a pre-hashed signature made by aead.dev/minisign, an independent implementation (selfupdate/testdata/minisign). The output of the minisign binary itself has not been checked; legacy signatures are covered by the spec-based signer only.

Checklist

  • make check passes (vet, lint, race tests, locale tests, cross-compile, tidy)
  • New or changed exported API has godoc comments and tests
  • Breaking changes are called out above and labeled breaking-change (there is no such label in this repository yet)
  • No new dependency, or the reason for it is explained above

🤖 Generated with Claude Code

dgrieser and others added 8 commits November 17, 2026 15:51
Values, Patterns and Marker move from secret to the new redact package,
which uses the standard library only. logx now imports redact, so a tool
that logs no longer compiles in go-keyring and dbus. secret.Redact,
secret.RedactPatterns and secret.Redacted stay as deprecated forwards.

Patterns took quadratic time: the YAML properties after each label were
searched for in all of the text that followed it. The pattern is now
anchored, which makes 100 KB of repeated labels about 100 times faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Updater with a Verifier also downloads the signature of the checksums
file and installs nothing unless it verifies. Minisign verifies minisign
signatures (pre-hashed and legacy) and trusts several keys for rotation.
Verifier and SkipChecksum together are refused. golang.org/x/crypto is
added for BLAKE2b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list at the root started with two spaces of indentation. It now starts
at the first column, as yq and kubectl write it. Snapshot tests of YAML
output in downstream tools need new expectations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fuzz targets cover redaction, style specifications, iCalendar folding and
escaping, truncation, single-line text, version ordering, archive
extraction, minisign verification and checksums. Coverage of secret rises
from 86% to 98%, of selfupdate from 91% to 98%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rendering and views of the list move to files of their own, and so do the
prompt and the reading of a secret. No behavior changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgrieser dgrieser added the enhancement New feature or request label Nov 17, 2026
dgrieser and others added 2 commits November 17, 2026 15:55
…ntation

The verifier was only tested against a signer written from the same reading
of the minisign format. A key and signature made by aead.dev/minisign now
guard against a shared misreading. The fixture is kept byte for byte on
every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the old executable is moved aside before the new one takes its
place, so a directory at the executable's path was carried off and the
update reported success. ReplaceExecutable now refuses a path that is not
a regular file on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgrieser
dgrieser merged commit b52ec1f into main Nov 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant