refactor: Write the split-token wire format and verifier compare once #85
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rosa/vernier!85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "domain/credential-split-token-dedup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the agent brief on #65: the split-token wire format and the constant-time verifier comparison were triplicated across the three credential families; now they're written once in
credential.rs, as its module doc always claimed.SplitTokenis the new home for the wire shape — anIdentifier/Verifierpair withparse(base64-decode, 32-byte check, 16/16 split) andencode(the inverse). The families'parse/Displaydelegate, keeping per-credential error context at the wrapper layer.VerifierHash::matchesowns thesubtle::ct_eqconstant-time comparison; the three record-verify paths call it. The PKCECodeChallengecomparison is a different shape and deliberately keeps its own.No behaviour changes: the round-trip and verifier-mismatch tests pass unmodified,
SplitTokenispub(crate)so nothing outside the domain crate is touched, and the fullcitask is green. Explicit wrapper calls were kept overFromimpls — each conversion has a single call site, so the trait would relocate the plumbing rather than remove it.Closes #65.