Skip to content

1.3.lts fix: prefer JWS header kid over jwk.kid in attach decorator verify#4095

Merged
jamshale merged 1 commit into
openwallet-foundation:1.3.ltsfrom
OpSecId:fix/4077-verify-kid-from-jws-header-1.3.lts
Mar 18, 2026
Merged

1.3.lts fix: prefer JWS header kid over jwk.kid in attach decorator verify#4095
jamshale merged 1 commit into
openwallet-foundation:1.3.ltsfrom
OpSecId:fix/4077-verify-kid-from-jws-header-1.3.lts

Conversation

@PatStLouis
Copy link
Copy Markdown
Contributor

When verifying JWS in attach decorator data, use kid from the JWS unprotected header first (canonical per spec). Fall back to jwk.kid only when header has no kid. Fixes DIDComm connection failure with agents (e.g. Credo) that put kid only in header and not in jwk.

Backport of #4085 for 1.3.lts.

  • Add test_verify_uses_kid_from_header_when_jwk_has_no_kid
  • Add test_verify_uses_kid_from_jwk_when_header_has_no_kid
  • Add test_verify_returns_false_when_signer_verkey_does_not_match

…ixes openwallet-foundation#4077)

When verifying JWS in attach decorator data, use kid from the JWS
unprotected header first (canonical per spec). Fall back to jwk.kid
only when header has no kid. Fixes DIDComm connection failure with
agents (e.g. Credo) that put kid only in header and not in jwk.

Backport of openwallet-foundation#4085 for 1.3.lts.

- Add test_verify_uses_kid_from_header_when_jwk_has_no_kid
- Add test_verify_uses_kid_from_jwk_when_header_has_no_kid
- Add test_verify_returns_false_when_signer_verkey_does_not_match

Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
Made-with: Cursor
@PatStLouis PatStLouis changed the title fix: prefer JWS header kid over jwk.kid in attach decorator verify 1.3.lts fix: prefer JWS header kid over jwk.kid in attach decorator verify Mar 18, 2026
@sonarqubecloud
Copy link
Copy Markdown

@PatStLouis PatStLouis requested review from jamshale and swcurran March 18, 2026 18:56
@jamshale jamshale merged commit 92f670b into openwallet-foundation:1.3.lts Mar 18, 2026
7 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