Skip to content

deps: bump ProtonMail/go-crypto to v1.5.2 (#82) - #87

Merged
bketelsen merged 2 commits into
mainfrom
lucilla/go-crypto-1.5.2
Nov 3, 2026
Merged

bketelsen merged 2 commits into
mainfrom
lucilla/go-crypto-1.5.2

Conversation

@frostyard-machines

Copy link
Copy Markdown

Closes #82.

Why

go.mod pinned github.com/ProtonMail/go-crypto at v1.0.0. From v1.2.0, clearsign.Decode follows RFC 9580 section 7.1: Block.Plaintext no longer ends with the line ending before the signature armor. getLine is unchanged (a CR before LF is still removed).

The signing path itself does not change: InRelease and the binary .sig files still come from the gpg CLI, and Release.gpg from go-crypto ArmoredDetachSign. The one break was the verifier: verifyReleaseSignatures compared Plaintext with Release byte for byte. With the bump alone, every prior signed generation would fail the reuse check and be re-signed (TestVerifyReleaseSignatures fails).

Change

  • go-crypto v1.0.0 → v1.5.2 (newest release).
  • internal/generator/deb/release_signature.go: new clearsignedPayload = Plaintext + one LF, the payload apt reads. The check behaves exactly as with v1.0.0. A Release without a final LF stays rejected (new test case).
  • internal/signer/gpg_compat_test.go: for LF, CRLF, with and without a final newline, and a dash-escaped line, every signature kind (SignCleartext, SignDetached, SignDetachedBinary, SignDetachedBinaryFromFile) verifies with gpg --verify and go-crypto. gpgv and sqv (the apt verifiers) also run when installed. Each subtest skips when its tool is missing; CI may lack them, and both ran locally. Also:
    • apt-style check: the InRelease cleartext section (dash-unescaped, LF-split) equals the input byte for byte when the input ends with LF.
    • Release.gpg is still a v4, binary-mode, SHA-512 signature.
    • The tests where the data is changed must fail: data plus x (gpg and Go), and CRLF data made LF-only (Go).
  • Docs: docs/specs/generators.md (payload rule), docs/design/overview.md, and a "Verified by" reference in ADR-0009. The split in ADR-0009 does not change.
  • No Dependabot ignore for go-crypto existed, so .github/dependabot.yml is unchanged.

Checks (local)

make build, make fmt, make lint (0 issues), go test -race -short ./..., govulncheck v1.9.0 (no vulnerabilities), node scripts/check-docs.mjs. The compat test runs 56 subtests with no skips here (gpg 2.4.7, gpgv, sqv).

No release: tagging stays with Brian.

…oad check

go-crypto v1.2.0 and later follow RFC 9580 section 7.1: clearsign
Block.Plaintext excludes the line ending before the signature armor.
verifyReleaseSignatures compared Plaintext with Release byte for byte, so
every prior signed generation would fail the reuse check and be re-signed.
Compare Plaintext plus one LF, the payload apt reads, as before.

Add gpg_compat_test.go: every signature kind verifies with gpg, gpgv, sqv
and go-crypto for LF, CRLF, with and without a final newline, and a
dash-escaped line; Release.gpg stays a v4 binary SHA-512 signature.

Closes #82
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 3, 2026
@frostyard-machines

Copy link
Copy Markdown
Author

Cross-review (reviewer openai/gpt-6.1-sol, coder github-copilot/mai-code-2-flash): Ready at ce703f9 (base b5dccc7), Blocking: none. Initial review at 18ff005: 2 low, non-blocking findings (helper comment scope; gpgv/sqv missing in the from-file subtest); both fixed in ce703f9 and confirmed in re-review 1. CI green at ce703f9. In CI, gpgv runs and passes; sqv is not installed on ubuntu-latest, so its subtests skip there (they ran and passed locally).

@bketelsen
bketelsen merged commit 720f6d5 into main Nov 3, 2026
3 checks passed
@frostyard-machines
frostyard-machines deleted the lucilla/go-crypto-1.5.2 branch November 3, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep ProtonMail/go-crypto at v1.0.0 until signing handles the v1.2.0 signed-text newline change

2 participants