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

feat: checking kb header value #133

Merged

Conversation

lukasjhan
Copy link
Member

I added checking logic of header of key binding JWT.

I referenced from standard:

8.3. Verification by the Verifier
3. Ensure that a signing algorithm was used that was deemede public key for the Holder from the SD-JWT
secure for the application. Refer to [RFC8725], Sections 3.1
and 3.2 for details. The none algorithm MUST NOT be accepted
5. Check that the typ of the Key Binding JWT is kb+jwt.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.43%. Comparing base (38ffb3c) to head (26df50c).

Additional details and impacted files
@@            Coverage Diff             @@
##             next     #133      +/-   ##
==========================================
+ Coverage   97.41%   97.43%   +0.01%     
==========================================
  Files          23       23              
  Lines        1899     1908       +9     
  Branches      273      279       +6     
==========================================
+ Hits         1850     1859       +9     
  Misses         49       49              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if (
!this.header?.alg ||
!this.header.alg ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now, but I think having an assertHeaderClaim method will help a lot here to make the code more readable and we can also return messages that tell the user on which property it failed.

like this: https://github.com/berendsliedrecht/sd-jwt-ts/blob/a1fb5fad0b938081e033233bae5569ae3b9fe8cb/packages/core/src/sdJwtVc/sdJwtVc.ts#L41

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, That's good idea.

@lukasjhan lukasjhan merged commit 34b24c0 into openwallet-foundation:next Mar 6, 2024
10 checks passed
cre8 pushed a commit to cre8/sd-jwt-js that referenced this pull request Mar 8, 2024
cre8 pushed a commit that referenced this pull request Mar 8, 2024
Signed-off-by: Lukas <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
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