Skip to content

Conversation

@Sukuna0007Abhi
Copy link
Contributor

Summary

This PR implements support for the new PSA endorsements profile tag:arm.com,2025:psa#1.0.0 as requested in issue #331, while maintaining backward compatibility with the legacy profile http://arm.com/psa/iot/1.

Changes Made

  • scheme.go: Added media type support for both signed and unsigned CoRIM with new PSA profile
  • corim_extractor.go: Updated profile validation to accept both old and new PSA profile URIs
  • endorsement_handler_test.go: Added comprehensive test coverage for profile support

Key Features

  • ✅ Support for new PSA profile tag:arm.com,2025:psa#1.0.0
  • ✅ Backward compatibility with legacy profile http://arm.com/psa/iot/1
  • ✅ Support for both signed and unsigned CoRIM formats
  • ✅ Comprehensive test coverage
  • ✅ Foundation prepared for future PSA software component support

Testing

All existing tests pass, and new tests verify that both profile URIs are properly supported.

Fixes #331

- Add support for new PSA endorsements profile 'tag:arm.com,2025:psa#1.0.0'
- Maintain backward compatibility with legacy profile 'http://arm.com/psa/iot/1'
- Update scheme.go to support both signed and unsigned CoRIM with new profile
- Update corim_extractor.go profile validation for both old and new profiles
- Add comprehensive test coverage for profile support
- Prepare foundation for PSA software component support

Signed-off-by: Sukuna0007Abhi <[email protected]>
func (o *CorimExtractor) SetProfile(profile string) {
o.Profile = profile
}
// Copyright 2022-2024 Contributors to the Veraison project.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update year in copyright

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sir

"reflect"

"github.com/veraison/corim/comid"
// "github.com/veraison/corim/comid/psa"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code

var refVal *handler.Endorsement
var err error

if o.Profile != "http://arm.com/psa/iot/1" && o.Profile != "tag:arm.com,2025:psa#1.0.0" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can be done before the for loop -- there is no need to re-do it on each iteration of the loop.

// reference-triple-record SHALL completely describe the updatable PSA RoT.
for i, m := range rv.Measurements.Values {
if m.Key == nil {
return nil, fmt.Errorf("measurement key is not present")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add the index to the error message (as below).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing it sir @setrofim

if err != nil {
return nil, fmt.Errorf("unable to extract measurement at index %d, %w", i, err)
}
// TODO: Uncomment when PSA profile dependency is available
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not do this.

If there is already an open pull request that implements the required dependency on the corim repo, link to it in the description of this pull, indicating it as prerequisite for this pull (note that you would need to update the go.mod in this pull once that is meraged).

If that does not yet exist, then close this pull request (or mark it as draft) and re-open it once the depency is available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attached the PR's related to it here : veraison/corim#221 & this veraison/cocli/pull/43

@Sukuna0007Abhi Sukuna0007Abhi marked this pull request as draft October 5, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Refresh CoRIM profiles

2 participants