Skip to content

Conversation

@mineme0110
Copy link
Contributor

Description:

The signed presentation for the credential request is DER-encoded, according to the JWS specification, the signature should not be DER-encoded. Instead, it should be a concatenation of R || S, Base64 URL-safe encoded (as per RFC 7515, Section 8.1)

(hyperledger-identus/cloud-agent#1541)

Alternatives Considered (optional):

Yes not follow the JWS and fix in cloud-agent to support both DER Encoded and JWS but will require handling both and wont benefit much, since it is JWT we should follow JWS spec

Checklist:

  • My PR follows the contribution guidelines of this project
  • My PR is free of third-party dependencies that don't comply with the Allowlist
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked the PR title to follow the conventional commit specification

@mineme0110 mineme0110 requested a review from a team as a code owner March 13, 2025 10:16
@mineme0110 mineme0110 changed the title fix: Signature encoding required to follow JWS specification fix: update signature encoding to follow JWS specification Mar 13, 2025
@coveralls
Copy link

coveralls commented Mar 13, 2025

Pull Request Test Coverage Report for Build 14056150531

Details

  • 19 of 38 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 75.378%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pollux/utils/jwt/DER.ts 17 36 47.22%
Totals Coverage Status
Change from base Build 14056133001: -0.2%
Covered Lines: 3445
Relevant Lines: 4378

💛 - Coveralls

@elribonazo
Copy link
Contributor

@mineme0110 mind retesting again? I've restored the function we had in the past to normalise the der signature into compact raw, should be working now!

@elribonazo elribonazo force-pushed the fix-signature-encoding branch from 48c601b to bd755c3 Compare March 25, 2025 09:26
mineme0110 and others added 2 commits March 25, 2025 10:30
Signed-off-by: mineme0110 <shailesh.patil@iohk.io>
Signed-off-by: Francisco Javier Ribo Labrador <elribonazo@gmail.com>
@elribonazo elribonazo force-pushed the fix-signature-encoding branch from bd755c3 to cc184c4 Compare March 25, 2025 09:30
@elribonazo elribonazo enabled auto-merge (squash) March 25, 2025 09:46
@elribonazo elribonazo merged commit 6ad04c0 into main Mar 25, 2025
6 checks passed
@elribonazo elribonazo deleted the fix-signature-encoding branch March 25, 2025 09:47
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.

4 participants