You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Evidence validation using swid.Evidence.Valid() method
## Summary
This commit implements Evidence validation in CoRIM using the newly added
Valid() methods from the SWID package, completing the work requested in
#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 #212
Related: veraison/swid#23 (done via veraison/swid#45 PR)
Signed-off-by: Sukuna0007Abhi <[email protected]>
0 commit comments