Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Support x5u, x5t, and x5t#S256 headers (for JWK) #242

Merged
merged 1 commit into from
May 29, 2019
Merged

Conversation

csstaub
Copy link
Collaborator

@csstaub csstaub commented May 28, 2019

Changes:

  • Support x5u, x5t, and x5t#S256 headers.
  • Check that cert pub key matches JWK pub key on unmarshal.
  • Check that thumbprints match X.509 leaf cert on marshal/unmarshal.
  • Add additional tests for invalid thumbprints, cert/key mismatch.

Note that we could do additional checks on the cert chain, like compare the key usage extension to the defined "use" in the JWK header. But I decided not to implement that at this time -- the standard is a bit fuzzy about how to match these (sigh). We also don't check the cert chain that the x5u URI points at, because we don't want to do an HTTP get on a JSON unmarshal and it could change at any time regardless.

cc @0x13A

@csstaub csstaub changed the title Support x5u, x5t, and x5t#S256 headers Support x5u, x5t, and x5t#S256 headers (for JWK) May 29, 2019
@csstaub csstaub merged commit aba61eb into master May 29, 2019
@csstaub csstaub deleted the cs/x5u-x5t branch May 29, 2019 19:41
mbyczkowski pushed a commit that referenced this pull request Mar 8, 2020
@mbyczkowski mbyczkowski mentioned this pull request Mar 8, 2020
@ramonberrutti
Copy link

@csstaub x5u need to be a string? WDYT?

@mbyczkowski
Copy link
Contributor

@ramonberrutti if you think there might be a bug, just open an issue and we can discuss there. Not many people will look at already-merged PRs.

mbyczkowski added a commit that referenced this pull request Apr 30, 2020
When support for optional x5u, x5t, and x5t#S256 parameters in JWK was added in #242 (and subsequently released in 2.5.0) it actually broke parsing of JWKs which included those parameters.

See #299 for detailed analysis and discussion.

Co-authored-by: Mat Byczkowski <mbyczkowski@gmail.com>
mbyczkowski added a commit that referenced this pull request Apr 30, 2020
When support for optional x5u, x5t, and x5t#S256 parameters in JWK was added in #242 (and subsequently released in 2.5.0) it actually broke parsing of JWKs which included those parameters.

See #299 for detailed analysis and discussion.

Cherry-picked from #304

Needed minor tweaks, since v2 doesn't use golangci linter nor Go
modules.

Co-authored-by: Mat Byczkowski <mbyczkowski@gmail.com>
mbyczkowski added a commit that referenced this pull request Apr 30, 2020
When support for optional x5u, x5t, and x5t#S256 parameters in JWK was added in #242 (and subsequently released in 2.5.0) it actually broke parsing of JWKs which included those parameters.

See #299 for detailed analysis and discussion.

Cherry-picked from #304

Needed minor tweaks, since v2 doesn't use golangci linter nor Go
modules.

Co-authored-by: Mat Byczkowski <mbyczkowski@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants