-
Notifications
You must be signed in to change notification settings - Fork 32
Add Evidence validation using swid.Evidence.Valid() method #224
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
Conversation
## Summary This commit implements Evidence validation in CoRIM using the newly added Valid() methods from the SWID package, completing the work requested in veraison#212. ## Changes - Added Evidence validation calls using swid.Evidence.Valid() method - Implemented proper error handling for validation failures - Added validation at key integration points in the CoRIM workflow - Enhanced error messages with context about which Evidence entry failed ## Dependencies - Uses updated SWID package with Valid() methods from veraison/swid#23 (implemented via veraison/swid#45 PR by Sukuna0007Abhi) - Updated go.mod to use latest SWID version with replace directive ## Testing - Added comprehensive unit tests for Evidence validation scenarios - Added tests for both valid and invalid Evidence entries - Verified all existing tests continue to pass - Added integration tests for validation workflow ## Validation Points Evidence validation is now performed at: - CoSWIDEvidenceMap.Valid() - validates individual evidence entries - CoSWIDEvidence.Valid() - validates evidence slice collections - CoSWIDTriple.Valid() - validates evidence within triples - AbbreviatedSwidTag.Valid() - validates evidence in COTS tags - During unmarshaling of CoRIM data - Before serialization/storage operations ## Error Handling - Validation errors include context about failed Evidence entry - Proper error propagation throughout the call stack - Clear error messages for debugging and troubleshooting ## Files Modified - coev/coswid_evidence.go: Added Valid() methods for evidence structures - coev/coswidtriple.go: Enhanced CoSWIDTriple validation - cots/abbreviated_swid_tag.go: Added evidence validation to SWID tags - go.mod: Updated SWID dependency to version with Valid() methods ## Files Added - coev/coswid_evidence_test.go: Comprehensive evidence validation tests - cots/abbreviated_swid_evidence_test.go: SWID tag evidence validation tests Implements veraison#212 Related: veraison/swid#23 (done via veraison/swid#45 PR) Signed-off-by: Sukuna0007Abhi <[email protected]>
|
Pls review sir @thomas-fossati sir @yogeshbdeshpande |
|
As veraison/swid#45 this is now merged, need to progress this as well! |
|
Please point to the right swid version in go.mod! |
|
Sure sir @yogeshbdeshpande will fix it after coming home from college, will
point under tonight,in that free time veraison/services#340 sorry to saying
again.(it's a docs so that's why)
…On Fri, 3 Oct 2025 at 17:52, Yogesh Deshpande ***@***.***> wrote:
*yogeshbdeshpande* left a comment (veraison/corim#224)
<#224 (comment)>
Please point to the right swid version in go.mod!
—
Reply to this email directly, view it on GitHub
<#224 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLZUP7MG6YXSHSYT3ZTODVL3VZS6ZAVCNFSM6AAAAACHPPLCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRVGQ3TSNJVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
ok, i will check! |
|
Thank you very much sir @yogeshbdeshpande
On Fri, 3 Oct 2025 at 18:00, Yogesh Deshpande ***@***.***>
wrote:
… *yogeshbdeshpande* left a comment (veraison/corim#224)
<#224 (comment)>
Sure sir @yogeshbdeshpande <https://github.com/yogeshbdeshpande> will fix
it after coming home from college, will point under tonight,in that free
time veraison/services#340 <veraison/services#340>
sorry to saying again.(it's a docs so that's why)
… <#m_3154148674653923842_>
On Fri, 3 Oct 2025 at 17:52, Yogesh Deshpande *@*.*> wrote:
yogeshbdeshpande left a comment (veraison/corim#224
<#224>) <#224 (comment)
<#224 (comment)>>
Please point to the right swid version in go.mod! — Reply to this email
directly, view it on GitHub <#224 (comment)
<#224 (comment)>>, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/BLZUP7MG6YXSHSYT3ZTODVL3VZS6ZAVCNFSM6AAAAACHPPLCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRVGQ3TSNJVGI
<https://github.com/notifications/unsubscribe-auth/BLZUP7MG6YXSHSYT3ZTODVL3VZS6ZAVCNFSM6AAAAACHPPLCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRVGQ3TSNJVGI>
. You are receiving this because you were mentioned.Message ID: @.*>
ok, i will check!
—
Reply to this email directly, view it on GitHub
<#224 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLZUP7J4UKJA3OVJHIA2JIT3VZT4VAVCNFSM6AAAAACHPPLCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRVGUYDCMBXGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@Sukuna0007Abhi Also, please fix the Linter error: |
|
Sure sir @yogeshbdeshpande I am fixing it.. |
4f6db50 to
355b58a
Compare
Co-authored-by: setrofim <[email protected]> Signed-off-by: Sukuna0007Abhi <[email protected]>
- Remove replace directive for veraison/swid since PR veraison#45 is merged - Update to latest veraison/swid version with Valid() methods - Fix invalid UUID in test data to use proper RFC4122 format - Apply go fmt formatting to test files - Update example test outputs to match corrected UUID values - Fix test error message expectations All tests now pass across all packages. Signed-off-by: Sukuna0007Abhi <[email protected]>
5601b5e to
f651356
Compare
- Fix import formatting by adding blank line between stdlib and third-party imports - Change CoSWIDEvidenceMap.Valid() to use pointer receiver to avoid hugeParam warning (104 bytes) - Update loop in CoSWIDEvidence.Valid() to use indexed access instead of range value Signed-off-by: Sukuna0007Abhi <[email protected]>
|
Ready for review sir and merge @yogeshbdeshpande @setrofim |
Signed-off-by: Sukuna0007Abhi <[email protected]>
|
Hi sir @yogeshbdeshpande the linters error is fixed and my commits are signed off , now I think it's ready for merge/review, |
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!
|
Let @setrofim : review it on Monday, and once he approves the same, we can Merge! |
|
Thanks sir @yogeshbdeshpande , kindly sorry to say , could you also review this one as sir @setrofim approved it also veraison/services#342 in your free time, thank you so much sir |
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
|
Thanks sir @yogeshbdeshpande sir @setrofim |
Summary
This PR implements Evidence validation in CoRIM using the newly added Valid() methods from the SWID package, completing the work requested in issue #212.
Dependencies
This implementation depends on the updated SWID package with Valid() methods from veraison/swid#23, which was completed via veraison/swid#45. The go.mod has been updated to use the SWID version containing these validation methods via replace directive.
Implementation Details
Core Validation Methods
CoSWIDEvidenceMap.Valid()
CoSWIDEvidence.Valid()
CoSWIDTriple.Valid()
AbbreviatedSwidTag.Valid()
Error Handling Strategy
The implementation provides comprehensive error handling with contextual information:
Testing Coverage
The implementation includes comprehensive test coverage:
Validation Scenarios
The following validation scenarios are now supported:
Example Usage
Resolves issue #212 in the CoRIM repository
Builds on validation methods from veraison/swid#23 ->Implemented using code from veraison/swid#45
Ready for review sir @thomas-fossati @setrofim @yogeshbdeshpande @jraman567 @deeglaze