Skip to content

spec(port): port the commit signature forgery guard (Refs #8883) - #9904

Closed
dmitrii-f-t27 wants to merge 2 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-c
Closed

dmitrii-f-t27 wants to merge 2 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-c

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

The third CR-CHAT-03 ring target (W3, tracker #8883, epic gHashTag/trios#1812): port of crates/trios-chat/rings/CR-CHAT-03/src/commit_signature.rs (Wave-24 Lane A, L-CHAT-3-csig, R-CHAT-3, RFC 9420 6.1/12).

Every MLS Commit is signed by its committer leaf key. The forgery gate pins the binding invariants before the caller delegates to the real signature check. Rules, in the original's fixed order:

  1. sig_blob non-empty AND non-zero (lazy-verifier trap),
  2. group_id agreement (splice rejection),
  3. from_epoch == current_epoch,
  4. committer currently a member,
  5. sig_pubkey == stored leaf-public (stale pre-rotation key rejected),
  6. ops_hash == locally computed hash (cross-commit splice).

Carried as the D5 verdict — the one variant with payload (EpochMismatch) carries the current and claimed epochs; the rest are unit codes.

Adaptations (t27 conventions): transcript/view structs → flat parameters, the signature blob as a plain slice; the view's Option<[u8; 32]> committer key → member flag + stored key (sentinel convention); the transcript's sender_leaf rides along unread by every rule, exactly as in the original. The original's tenth test is a tautology green summary (a count asserted against itself) — replaced with a live canonical gate call, the WPS-10 precedent, so no test passes vacuously.

All 10 original CSF tests transcribed with exact asserts (CSF-09 is the original's own check-order invariant: with every other field also wrong, the empty signature is still the answer), plus helper tests and a full rule-order ladder stacking every later violation under each earlier rule (13 total).

Checks (conventions 0-14): t27b test 13 passed 0 failed, 0 blockers; t27c test-report 13/13, 0 vacuous; gen-rust output compiles under rustc (0 'static str, 0 Vec<const); coverage Untested 0; ASCII only; seal saved, all hashes MATCH; ledger row added to docs/reports/t27b_expectations.json.

Refs #8883

The third CR-CHAT-03 ring target (W3, L-CHAT-3-csig, R-CHAT-3,
RFC 9420 6.1/12): the commit-signature binding rules, in the
original's fixed order - the blob non-empty and non-zero (the
lazy-verifier trap), the group agreement, the epoch
agreement, the committer a current member, the signer key
the stored leaf-public, and the ops hash the locally computed
one - as the D5 verdict with the one payload pair (the
current and claimed epochs of the epoch rule), the original's
rule order, and all ten CSF tests transcribed plus helper and
rule-order tests.

The original's transcript and view structs become flat
parameters, the signature blob arriving as a plain slice.
The view's Option<[u8; 32]> committer key becomes a member
flag plus the stored key - the sentinel convention. The
transcript's sender leaf rides along unread by every rule,
exactly as in the original. The original's tenth test is a
tautology green summary (a count asserted against itself);
this port replaces it with a live canonical gate call, the
WPS-10 precedent, so no test passes vacuously.

Checks (conventions 0-14): t27b test 13 passed 0 failed; t27c
test-report 13/13, 0 vacuous; gen-rust output compiles under rustc;
coverage Untested 0; ASCII only; seal saved, all hashes MATCH;
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

All required checks green (validate, check-linked-issue, parse-ratchet, t27b-native-linux, t27b-native-macos); cli-tri / duplicate-bodies / t27b-native-ratchet are the known non-required reds. Steward READY. Third CR-CHAT-03 target (3/47 T-PORT) — requesting owner merge when convenient, Refs #8883.

This was referenced Oct 17, 2026
This was referenced Oct 17, 2026
# Conflicts:
#	docs/reports/t27b_expectations.json
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

Superseded by #10175: the remaining CR-CHAT targets now land as one port-wave batch per specs/policy/pr_budget.t27 (#10067/#10074), which asks for one PR per ring batch instead of one per file. The spec body, seal and ledger row in this PR are unchanged there; the batch also carries one self-consistent duplicate-body bless. Closing this one-file PR keeps the merge queue and the Actions queue small.

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.

1 participant