Skip to content

v2 c2sp - #1983

Open
jku wants to merge 4 commits into
v2-foundationsfrom
v2-c2sp
Open

v2 c2sp#1983
jku wants to merge 4 commits into
v2-foundationsfrom
v2-c2sp

Conversation

@jku

@jku jku commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

c2sp: Add C2SP tlog-proof, identity-transparency, and checkpoint primitives

Add internal C2SP transparency log primitives under sigstore._internal.c2sp to enable implementation of the rekor-tiles (rekor v2) identity service client.

Most of this is mechanical implementation of a fairly well written released specs, I will try to note the exceptions.

Ambiguities or sigstore specific deviations:

  • c2sp.org/identity-transparency/v1 context key-value handling is not defined in spec (context is just a blob).
  • the OIDC claim key names follow rekor-tiles -- these do not seem to be in any spec
  • OIDC receipt is b"\x00" * 32 -- this is allowed and is what rekor-tiles does

No release notes as it's purely internal and not used in the public API yet.

AI assisted: yes.

#1966


Stack created with GitHub Stacks CLI • Give Feedback 💬

jku added 3 commits November 19, 2026 09:41
…rifier

Implement sigstore._internal.c2sp.proof with TLogProof parsing, serialization, extra-claim encoding/decoding, and RFC 6962 Merkle inclusion verification.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

Co-authored-by: Antigravity with Gemini 4 Argon
…mputation

Implement sigstore._internal.c2sp.identity for computing domain-separated signature payloads and binary Merkle leaf hashes for public-key and OIDC entries per c2sp.org/identity-transparency/v1.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

Co-authored-by: Antigravity with Gemini 4 Argon
This slightly duplicates earlier rekor checkpoint code... but since
that has some historical baggage I kept this implementation separate.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Co-authored-by: Antigravity with Gemini 4 Argon
@jku

jku commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

I have some self review notes I will address before making this ready for review

Address C2SP spec compliance gaps and review findings across proof,
checkpoint, and identity modules:

- Enforce canonical RFC 4648 Section 3.5 Base64 decoding across
  tlog-proof, checkpoint root hashes, and note signature lines.
- Reject duplicate (name, key_id) signature lines and bound maximum
  signature count (64) and inclusion proof hash count (64).
- Restrict signature type 0x06 / subtree/v1 strictly to ML-DSA-44 and
  reject timestamp == 0 on ML-DSA-44 checkpoint cosignatures to prevent
  subtree/checkpoint confusion.
- Validate checkpoint origin and cosigner names per tlog-cosignature
  (valid note name, <= 255 UTF-8 bytes) and guard uint64 bounds before
  int() / struct.pack() to avoid leaking ValueError or struct.error.
- Require witness verifiers to be ML-DSA-44 (0x06) or Ed25519 with
  cosignature=True (0x04), ignore witness verifiers matching the log's
  own origin so a log cannot count as its own witness, fail closed on
  unsupported public key types and curves at NoteVerifier construction,
  validate key_id length >= 4, and chain verification error causes.
- Narrow compute_oidc_leaf_hash to str and reject empty claim keys/values.
- Add independent interop test vectors (c2sp.org/signed-note example,
  live staging ML-DSA-44 checkpoint, and rekor-tiles v2.4.2 identity_v1
  leaf hashes), byte-layout tests, extension-line tests, partial
  (name, key_id) match tests, and negative test coverage.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Assisted-by: Antigravity with Gemini
@jku

jku commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

Making sure we really follow the specs did make the code a little longer but is likely worth it: there were at least two actual issues in the missing checks.

I consider this ready for eview

@jku
jku marked this pull request as ready for review November 19, 2026 11:30

This branch has not been deployed

No deployments
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