chain: COSE-signed checkpoints and the conformance suite#421
Closed
damienrch wants to merge 5 commits into
Closed
Conversation
…media type RFC 9864 (Oct 2025) deprecated the polymorphic EdDSA identifier (-8) in favour of fully-specified Ed25519 (-19), and RFC 6838 s3.1 makes unfaceted application/provetrail-* names unobtainable outside the standards tree, so the checkpoint protected header now carries alg -19 and application/vnd.provetrail.checkpoint+cbor. The signature bytes are unchanged Ed25519. go-cose v1.3.0 predates RFC 9864 and its NewSigner/NewVerifier reject -19, so ed25519CoseSigner/ed25519CoseVerifier carry the label themselves; Sign1 sign/verify only compare the header algorithm against the signer's, so no fork of the library is needed. Conformance crypto vectors regenerated in one event (go test ./chain/conformance -update); this is the single pre-freeze byte change the Provetrail v0.1.0 gate allows.
The crypto.run.* vectors were tagged L3 while CONFORMANCE.md placed run-record root integrity at L2, where the tier definition (Merkle-leaf integrity over carried bytes) puts it. Retag the five run vectors L2 and keep event_proof and consistency at L3 as the standalone transparency proofs. Manifest-only regeneration; no vector bytes changed.
Verifier hardening, no wire-byte changes: - decodeCheckpoint enforces payload canonicality (re-encode and compare) and a full SHA-256 root; checkpointPayload refuses to sign a short root. - VerifyRun refuses an empty record with record.empty before the size comparison, so a signed size-0 checkpoint cannot make emptiness pass. - VerifyEventProof names record.index_out_of_range for an index outside the signed size and merkle.missing_node for a path shorter than the tree shape requires (delivered length computed via Rehash). - toCanonical enforces the closed actor category (enc.invalid_actor). - Tree.Root returns the RFC 6962 empty root for an empty tree, matching its own documentation. Conformance suite grows 34 -> 64 vectors: structural schema and boundary coverage (seq gaps, ints beyond 2^53, unicode keys, bstr payloads, full-envelope rejects) and the crypto mutant matrix (checkpoint header and payload axes, run-container framing axes, operational proof codes).
SPEC Section 8.2 rules that required string fields are encoded even when empty, as zero-length text strings. valid.empty_strings.01 pins the ruling.
gofumpt and gofmt disagree about alignment when a map key is a wide rune, and the lint gate follows gofumpt. Whitespace only.
Collaborator
|
Opened under the wrong identity. Reopening from the workspace account. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Four commits that were made directly on local main and never reviewed. Moved onto a branch so they land through a PR.
0cb28a5feat(catalog): pin token v0.1.2 and solana-signer v0.1.1518995fchain: sign checkpoints under COSE algorithm -19 and the vendor-tree media type9baa8b3chain/conformance: run-record vectors are L2, per the tier definition2c9561cchain: harden the reference verifier and complete the conformance suitee3e9aa5chain/conformance: pin the empty-string ruling with a vectorTask: 0a671767-3e9b-44ee-9a56-2298f94825e0