Skip to content

policy: verify every known signature; proof: decode base64 strictly - #286

Merged
mhutchinson merged 1 commit into
transparency-dev:mainfrom
benbirt:strict-policy-verify
Oct 7, 2026
Merged

mhutchinson merged 1 commit into
transparency-dev:mainfrom
benbirt:strict-policy-verify

Conversation

@benbirt

@benbirt benbirt commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

TLogPolicy.Verify used to stop at the first log key whose signature verified, and Satisfied opened the note once per witness, stopping as soon as the quorum was met. Signatures from other known keys were never looked at, so a checkpoint carrying an invalid signature from a known log or witness could still be accepted.

c2sp.org/signed-note says that if a signature's key name and ID match a known key, verifiers MUST verify it, and SHOULD reject the whole note if it fails; c2sp.org/tlog-proof likewise says to "verify all cosignatures for witnesses known to the verifier". Verify now opens the checkpoint once with all of the policy's log and witness keys, so note.Open checks every known signature and fails on any invalid one, then applies the log-origin and quorum rules to the verified signatures. Satisfied does the same with the witness keys. Signatures from unknown keys are still ignored.

Separately, c2sp.org/tlog-proof requires decoders to reject non-canonical base64, so TLogProof.Unmarshal now decodes the extra data and inclusion hashes with base64.StdEncoding.Strict(), which rejects non-zero padding bits. Other formats (checkpoints, vkeys, signed notes) are left unchanged, as their specs don't require this.

TLogPolicy.Verify used to stop at the first log key whose signature
verified, and Satisfied opened the note once per witness, stopping as
soon as the quorum was met. Signatures from other known keys were never
looked at, so a checkpoint carrying an invalid signature from a known
log or witness could still be accepted.

c2sp.org/signed-note says that if a signature's key name and ID match a
known key, verifiers MUST verify it, and SHOULD reject the whole note if
it fails; c2sp.org/tlog-proof likewise says to "verify all cosignatures
for witnesses known to the verifier". Verify now opens the checkpoint
once with all of the policy's log and witness keys, so note.Open checks
every known signature and fails on any invalid one, then applies the
log-origin and quorum rules to the verified signatures. Satisfied does
the same with the witness keys. Signatures from unknown keys are still
ignored.

Separately, c2sp.org/tlog-proof requires decoders to reject
non-canonical base64, so TLogProof.Unmarshal now decodes the extra data
and inclusion hashes with base64.StdEncoding.Strict(), which rejects
non-zero padding bits. Other formats (checkpoints, vkeys, signed notes)
are left unchanged, as their specs don't require this.
@benbirt
benbirt requested a review from a team as a code owner October 7, 2026 13:47
@benbirt
benbirt requested a review from mhutchinson October 7, 2026 13:47
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.47%. Comparing base (fa00c16) to head (8b04f1f).
⚠️ Report is 194 commits behind head on main.

Files with missing lines Patch % Lines
policy/tlog_policy.go 97.95% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #286      +/-   ##
==========================================
+ Coverage   82.57%   87.47%   +4.90%     
==========================================
  Files           5       10       +5     
  Lines         241     1030     +789     
==========================================
+ Hits          199      901     +702     
- Misses         30      128      +98     
+ Partials       12        1      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mhutchinson
mhutchinson merged commit 65795b9 into transparency-dev:main Oct 7, 2026
14 checks passed
@benbirt
benbirt deleted the strict-policy-verify branch October 7, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants