Skip to content

Ticket 54/step 9 review fixes - #117

Merged
wistefan merged 3 commits into
ticket-54/workfrom
ticket-54/step-9-review-fixes
Aug 28, 2026
Merged

Ticket 54/step 9 review fixes#117
wistefan merged 3 commits into
ticket-54/workfrom
ticket-54/step-9-review-fixes

Conversation

@wistefan

Copy link
Copy Markdown
Collaborator

No description provided.

… proof metadata

Fixes the findings from the review of PR #116.

Critical

1. Proof options are now canonicalized under the document context extended
   with https://w3id.org/security/suites/jws-2020/v1, so created,
   verificationMethod, proofPurpose, challenge and domain are covered by the
   signature. Previously the plain credentials/v1 context dropped all of them
   and the canonical proof options collapsed to a single type triple, leaving
   challenge and domain attacker-controlled. assertProofOptionsCovered fails
   closed if a populated field produces no triple.
2. LDProofChecker binds the proof key to the claimed identity: a credential
   proof must come from the credential's issuer, a presentation proof from the
   presentation's holder. It also requires the matching proofPurpose and, when
   the DID document declares verification relationships, that the key is
   authorized for authentication / assertionMethod.
3. JSON-LD credentials without a proof are rejected (ErrorUnsignedCredential)
   instead of silently accepted.
4. JSON-LD credentials embedded in a JWT VP go through the same credential
   verification as those in a JSON-LD VP.

Major

5. Tests run against the real, vendored W3C credentials/v1 and jws-2020
   contexts (common/contexts, embedded in the binary) instead of a synthetic
   context that defined the proof terms at the top level. Verification no
   longer depends on the network for those contexts either.
6. Rewrote the abandoned TestParseJSONLDPresentation_ValidVPWithCredentials
   into tests that actually sign a VP containing a signed credential, plus
   negative cases for unsigned, forged and tampered credentials.
7. GenerateToken (vp_token and token-exchange grants) enforces the domain
   binding; an omitted domain is a mismatch rather than a skipped check.
8. CLAUDE.md updated; the working IMPLEMENTATION_PLAN.md is replaced by
   docs/json-ld-proof-verification.md describing the resulting design.

Minor

9.  gofmt applied to the files this branch touches.
10. Collapsed jsonldVPProofKey into common.VPKeyProof; no literal "proof".
11. Removed the duplicated CachingStatusListClient doc comment and the
    overstated MITM claim.
12. Explicit EC curve cross-check (ES256 -> P-256, ES384 -> P-384,
    ES512 -> P-521).
13. signVerifiablePresentation falls back to a default document loader when
    M2MTokenProvider was built as a struct literal.
14. InitPresentationParser now runs before InitVerifier so the status-list
    client is handed the LDProofChecker explicitly instead of reaching for a
    package global.
15. proofPurpose is validated.
16. IMPLEMENTATION_PLAN.md removed from the repo root.

Behaviour changes worth calling out:
- Status lists must be issued by the issuer of the credential that references
  them (StatusListCredentialClient.Fetch takes the expected issuer).
- Signing adds the suite context to the presentation, so M2M tokens carry an
  additional @context entry.
- m2m.verificationMethod must be an absolute DID URL; the built-in default
  ("JsonWebKey2020") is not, and a startup warning is logged.
@wistefan
wistefan merged commit a5346d5 into ticket-54/work Aug 28, 2026
@wistefan
wistefan deleted the ticket-54/step-9-review-fixes branch August 28, 2026 05:40
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