Repository navigation
id-core: mutual cross-signed key links - #11982
Merged
Merged
Conversation
Adds graph/cross_signing.rs: a key-link challenge binding the ordered key pair, purpose, exact scope, nonce and expiry into one canonical byte string; a link is mutual only when both keys sign identical bytes, either key can revoke, and the only output is a status, so no account, identity or authority is merged. tests/cross_signing_challenge.rs checks it against an independent signature and field-equality reference. Refs #10240 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Before: two keys had no way to say "we both approve this link". There was no record that two keys could each sign, and nothing stopped one-sided or mismatched claims from looking like an agreement.
After:
id-corehas a cross-signing module. A key-link challenge binds the ordered key pair, a purpose, an exact scope, a nonce and an expiry into one canonical byte string. Each key signs it separately, and a link is mutual only when both keys have signed identical bytes. Changing any field makes a separate challenge, so one-sided or unrelated statements never pair. Either key can revoke, and expiry ends a link. A mutual link proves only that both keys approved the statement. It merges no account, identity or authority.Refs #10240 (slice A-GRAPH-9132-02, design part A §11, statements S5.58, S5.59, S5.60, S5.63).
How
crates/id-core/src/graph/cross_signing.rs(new):LinkChallengestores the two keys in ascending order, so both parties build the same bytes:[1, "id/key-link", first, second, purpose, scope, nonce, expires]. Decoding rejects keys that are out of order or equal, purposes or nonces that are empty or too long, and any non-canonical encoding.KeyLinks::admit_statementverifies the envelope (domainid/key-link, profiledelegation/v1) and requires the signer to be one of the two keys. Statements are grouped by the hash of their challenge bytes.KeyLinks::admit_revocationaccepts a revocation signed by either key of a known challenge.KeyLinks::statusreturnsUnknown,Pending,Mutual,Expired(with the profile's clock skew) orRevoked. A status is the module's only output.crates/id-core/src/graph/delegation.rs:Scope::to_valueandfrom_valueare nowpub(crate), so a link reuses the delegation scope encoding.crates/id-core/tests/cross_signing_challenge.rs(new, oracle: invariant): 8 tests. The test has its own signature check, usinged25519-dalekover the signed-body preimage, and its own exact field checker for challenge bytes. A 512-case proptest admits random honest, tampered and wrong-domain statements over a base challenge and five near-miss variants, then random revocations. It compares acceptance and every status with the reference. Targeted tests cover each field mismatch, outsider signers, canonical bounds, the exact skew edge, revocation by either key, and that a mutual link with the space owner grants no delegated authority.Evidence:
cargo test -p id-core --test cross_signing_challengepasses 8 of 8,delegation_modelstill passes 18 of 18, and clippy is clean for the touched files. 21 hand-written mutants ofcross_signing.rs(every bound, signer check, domain check, canonical check and status branch) are all killed.Rollback: revert this PR. Nothing else calls the module yet.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.