Skip to content

id-core: mutual cross-signed key links - #11982

Merged
dezren39 merged 1 commit into
mainfrom
claude/key-link-cross-signing
Nov 19, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/key-link-cross-signing

Conversation

@dezren39

@dezren39 dezren39 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

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-core has 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):
    • LinkChallenge stores 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_statement verifies the envelope (domain id/key-link, profile delegation/v1) and requires the signer to be one of the two keys. Statements are grouped by the hash of their challenge bytes.
    • KeyLinks::admit_revocation accepts a revocation signed by either key of a known challenge.
    • KeyLinks::status returns Unknown, Pending, Mutual, Expired (with the profile's clock skew) or Revoked. A status is the module's only output.
  • crates/id-core/src/graph/delegation.rs: Scope::to_value and from_value are now pub(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, using ed25519-dalek over 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_challenge passes 8 of 8, delegation_model still passes 18 of 18, and clippy is clean for the touched files. 21 hand-written mutants of cross_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


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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>
@dezren39
dezren39 requested a review from a team as a code owner November 19, 2026 01:40
@dezren39
dezren39 merged commit b6208cb into main Nov 19, 2026
@dezren39
dezren39 deleted the claude/key-link-cross-signing branch November 19, 2026 01:40
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69d98632-81dd-4177-bfb9-f1e5a7dbb8fd
Commits

Reviewing files that changed from the base of the PR and between d8e87d9 and 9f4982e.

Files selected for processing: 3

  • pkgs/id/crates/id-core/src/graph/cross_signing.rs
  • pkgs/id/crates/id-core/src/graph/delegation.rs
  • pkgs/id/crates/id-core/tests/cross_signing_challenge.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T01:41:36.550536Z 9f4982e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants