-
Notifications
You must be signed in to change notification settings - Fork 88
[INJIMOB-3727] Add cbor encoding for mso object for signing #579
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
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Piyush7034 <[email protected]>
WalkthroughThe PR updates Changes
Sequence Diagram(s)(Skipped — changes are localized serialization/signing adjustments without multi-component flow requiring visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
certify-service/src/main/java/io/mosip/certify/utils/MDocProcessor.java (1)
458-484: Error handling gap:encodeToCBORexceptions bypass the catch block.The
encodeToCBORmethod (line 224-235) throws a genericException, but the catch block on line 481 only catchesCertifyException. If CBOR encoding fails, the exception propagates unwrapped, bypassing the error logging and consistent error wrapping.Proposed fix to catch all exceptions
} catch (CertifyException e) { log.error("Error during COSE signing: {}", e.getMessage(), e); throw new CertifyException(ErrorConstants.VC_SIGNING_ERROR, "COSE signing failed: " + e.getMessage()); + } catch (Exception e) { + log.error("Error during COSE signing: {}", e.getMessage(), e); + throw new CertifyException(ErrorConstants.VC_SIGNING_ERROR, "COSE signing failed: " + e.getMessage()); }
| @@ -470,6 +472,9 @@ public byte[] signMSO(Map<String, Object> mso, String appID, String refID, Strin | |||
| protectedHeader.put("x5c", true); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove setting up of protected header?
Since only alg is requried to be in the protected header which is already added by the Cose_Sign1 creating function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Signed-off-by: Piyush7034 <[email protected]>
|




Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.