Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pad elliptic curve coordinates correctly in JWK representation #22

Conversation

SalladinBalwer
Copy link
Contributor

When creating and using JWK representations the byte array is padded at the start with 0x00 to ensure that all hashes of the JWK will be correct.

When calculating the hashed token in parse.go and when creating proofs in create.go the FillBytes(buf []byte) function is used on the big.Int to get the byte array representation with added zeros at the start.

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

@SalladinBalwer SalladinBalwer self-assigned this Nov 20, 2024
@SalladinBalwer SalladinBalwer requested a review from a team as a code owner November 20, 2024 11:43
@SalladinBalwer SalladinBalwer linked an issue Nov 20, 2024 that may be closed by this pull request
1 task
@SalladinBalwer SalladinBalwer enabled auto-merge (squash) November 20, 2024 11:54
@SalladinBalwer SalladinBalwer merged commit 433762b into main Nov 21, 2024
5 checks passed
@SalladinBalwer SalladinBalwer deleted the 21-bug-invalid-jwk-thumbprint-when-leading-zeros-in-jwk-coordinate branch November 21, 2024 10:32
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.

[Bug]: Invalid JWK thumbprint when leading zeros in JWK coordinate
2 participants