-
Notifications
You must be signed in to change notification settings - Fork 247
Use new CBOR wrappers in COSE verifier #7573
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: main
Are you sure you want to change the base?
Use new CBOR wrappers in COSE verifier #7573
Conversation
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.
Pull request overview
This pull request refactors the COSE verifier implementation to use new CBOR wrapper functions instead of raw QCBOR API calls, improving code maintainability and error handling.
Changes:
- Replaced manual QCBOR decoding with higher-level CBOR wrapper API calls in two functions
- Simplified error handling using
rethrow_with_msghelper for better context in error messages - Removed significant boilerplate QCBOR code in favor of cleaner API
Comments suppressed due to low confidence (1)
src/crypto/openssl/cose_verifier.cpp:26
- The function
qcbor_buf_to_stringappears to be unused after the refactoring. Consider removing it to eliminate dead code.
std::string qcbor_buf_to_string(const UsefulBufC& buf)
{
return {reinterpret_cast<const char*>(buf.ptr), buf.len};
}
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/crypto/openssl/cose_verifier.cpp:26
- The
qcbor_buf_to_stringfunction is no longer used after the refactoring to use new CBOR wrappers. This unused function should be removed to improve code maintainability.
std::string qcbor_buf_to_string(const UsefulBufC& buf)
{
return {reinterpret_cast<const char*>(buf.ptr), buf.len};
}
Towards #7542.