-
Notifications
You must be signed in to change notification settings - Fork 33
fix: Support multiple authorized-by keys in Measurement struct (fixes #195) #219
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: Support multiple authorized-by keys in Measurement struct (fixes #195) #219
Conversation
|
Hi sir @yogeshbdeshpande AND sir @thomas-fossati: PR #219 fixes Issue #195 (support multiple authorized-by keys), adds graceful CBOR/JSON compatibility and tests — all checks passed; please review and approve to unblock merging. |
setrofim
left a 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.
The compatibility implementation here is unnecessary. The CoRIM spec is still in draft and constantly evolving. The implementation does not need to be compatible with previous revisions of the draft. Instead, all tests and examples should be aligned with the current implementation.
comid/cryptokeys.go
Outdated
| if len(o) == 0 { | ||
| return "empty crypto keys" | ||
| } | ||
| return fmt.Sprintf("CryptoKeys with %d keys", len(o)) |
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.
If would be more useful to return the string representation of the list of all keys.
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.
FIX
…orized-by keys Addresses reviewer feedback from setrofim in PR veraison#219: - Remove unnecessary compatibility implementation as CoRIM spec is in draft - Align all tests and examples with current implementation instead of maintaining compatibility Core Changes: - comid/measurement.go: Changed AuthorizedBy from *CryptoKey to *CryptoKeys (arrays) - comid/cryptokeys.go: Added String() method returning array representation - coev/coswid_evidence.go: Updated AuthorizedBy to use CryptoKeys - coserv/quads.go: Updated authorities to use CryptoKeys arrays Test Data Updates: - Updated all JSON templates to use array format for authorized-by - Updated diagnostic files (.diag) to use CBOR array syntax [554(...)] - Regenerated all CBOR test files using cbor-diag tool - Updated expected test outputs to show 'CryptoKeys: [...]' format Testing: - All packages now pass tests: comid, comid/tdx, coev, coev/tdx, coserv - Supports multiple authorized-by keys as required by issue veraison#195 - No backward compatibility - clean implementation for draft spec Fixes veraison#195
a22193e to
1651e4d
Compare
|
@setrofim I've addressed all your feedback: Changes Made:
Core Updates:
Test Data Updates:
Testing Results:All packages now pass tests:
The implementation now cleanly supports multiple authorized-by keys as arrays without any compatibility baggage, as requested. Ready for review! |
…orized-by keys Addresses reviewer feedback from setrofim in PR veraison#219: - Remove unnecessary compatibility implementation as CoRIM spec is in draft - Align all tests and examples with current implementation instead of maintaining compatibility Core Changes: - comid/measurement.go: Changed AuthorizedBy from *CryptoKey to *CryptoKeys (arrays) - comid/cryptokeys.go: Added String() method returning array representation - coev/coswid_evidence.go: Updated AuthorizedBy to use CryptoKeys - coserv/quads.go: Updated authorities to use CryptoKeys arrays Test Data Updates: - Updated all JSON templates to use array format for authorized-by - Updated diagnostic files (.diag) to use CBOR array syntax [554(...)] - Regenerated all CBOR test files using cbor-diag tool - Updated expected test outputs to show 'CryptoKeys: [...]' format Testing: - All packages now pass tests: comid, comid/tdx, coev, coev/tdx, coserv - Supports multiple authorized-by keys as required by issue veraison#195 - No backward compatibility - clean implementation for draft spec Fixes veraison#195 Signed-off-by: Kallal Mukherjee <[email protected]>
1651e4d to
c96f36b
Compare
setrofim
left a 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.
LGTM
|
@7908837174 Thank you so much for all the hard work on this PR, I have looked at this and it all Looks Good to Me! |
yogeshbdeshpande
left a 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.
LGTM!
|
@7908837174 : Can you please check this minor linter error on file format, so that once fixed, we can merge the PR |
- Remove extra blank line in comid/cryptokeys.go line 44 - Fix struct field alignment in coserv/quads.go - Resolves failing lint job 51776361051
|
@7908837174 : Thank you Kallal for the great work! I have merged your PR now! |
|
Huge thanks to sir @setrofim and sir @yogeshbdeshpande for the thoughtful reviews and support! |
|
@7908837174 I think, your list in in-correct! |
|
Kindly requesting review from @yogeshbdeshpande for PR veraison/docs#64 and PR veraison/services#344 .. |
Summary
This PR fixes GitHub issue #195 - Conditional endorsement series triple test failing.
Problem
The field was defined as (single key), but the TCG specification and conditional endorsement series test data require support for multiple keys. This caused CBOR unmarshalling to fail with:
Root Cause Analysis
Solution
1. Updated Measurement Structure
2. Added Compatibility Methods
3. Backward Compatibility
4. Applied Proposed Test Fix
Testing Results
Before Fix - Test Failed
After Fix - Test Passes
Full Compatibility
Code Changes
Modified Files:
Key Implementation Details:
Spec Compliance
This change aligns the implementation with the TCG Concise Evidence specification, which requires support for multiple authorization keys in measurement records. The implementation now correctly handles: