Skip to content

Validate DID by default in check command#39

Merged
takuro-sato merged 7 commits into
mainfrom
takurosato/check-did
May 20, 2026
Merged

Validate DID by default in check command#39
takuro-sato merged 7 commits into
mainfrom
takurosato/check-did

Conversation

@takuro-sato
Copy link
Copy Markdown
Contributor

@takuro-sato takuro-sato commented May 19, 2026

Summary

Make sign1util check automatically validate the embedded iss against the cert chain when --did is omitted, fix a swallowed-error bug in the resolver path, and stabilise the Makefile tests.

Changes

  • cmd/sign1util/main.go
    • check: if --did is not provided, resolve the COSE document's own iss against the embedded chain and return any resolver error to the caller.
    • Fix := shadowing in checkCoseSign1 that previously dropped Resolve errors.
    • Scope DID resolution in checkCoseSign1 to callers that actually pass a didString, so unrelated commands (print, leaf, did-x509 -in) don't perform unwanted DID resolution.
  • pkg/cosesign1/Makefile
    • Recipes that need a real DID (did-check, did-fail-subject) now derive it inline from chain.pem at recipe time. The previously-introduced AUTOPARSE_CHAIN toggle and shared ISSUER_DID variable are removed — they conflated the COSE iss label (a literal asserted by the unit test) with a verifiable DID.
    • Negative tests (did-fail-*) invert the expected non-zero exit with ! so the make target succeeds on a tool-level failure.
  • pkg/cosesign1/Makefile.certs

Tests

make all and go test ./... pass locally.

@takuro-sato takuro-sato requested a review from KenGordon May 20, 2026 12:17
@takuro-sato takuro-sato merged commit 56e4c66 into main May 20, 2026
5 checks passed
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