Repository navigation
policy: verify every known signature; proof: decode base64 strictly - #286
Merged
Merged
Conversation
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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
mhutchinson
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.