Skip to content

fix(scheme): align PSA/CCA with CoRIM profiles#401

Open
abhiraj-ku wants to merge 1 commit intoveraison:mainfrom
abhiraj-ku:refresh-corim-profiles
Open

fix(scheme): align PSA/CCA with CoRIM profiles#401
abhiraj-ku wants to merge 1 commit intoveraison:mainfrom
abhiraj-ku:refresh-corim-profiles

Conversation

@abhiraj-ku
Copy link
Copy Markdown

Migrate PSA-IoT and ARM-CCA scheme handling to latest profile APIs and string measurement keys.

Regenerate PSA and ARM-CCA CoRIM test vectors and update negative cases to match new profile validation behavior.

@abhiraj-ku abhiraj-ku force-pushed the refresh-corim-profiles branch from 9777357 to 68a8817 Compare March 21, 2026 11:14
@abhiraj-ku abhiraj-ku changed the title [RFC]fix(scheme): align PSA/CCA with CoRIM profiles fix(scheme): align PSA/CCA with CoRIM profiles Mar 21, 2026
@abhiraj-ku abhiraj-ku marked this pull request as ready for review March 21, 2026 11:16
@yogeshbdeshpande
Copy link
Copy Markdown
Collaborator

@abhiraj-ku Please check why integration tests are failing, the simple clue could be that the expected test vectors have not been modified to match the changes

@abhiraj-ku abhiraj-ku force-pushed the refresh-corim-profiles branch from 68a8817 to 9c2ea92 Compare March 26, 2026 09:33
Copy link
Copy Markdown
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

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

CoRIM validation in scheme/arm-cca/corim.go and scheme/psa-iot/corim.go should now be redundant, as that the updated profile code should handle that.

It should be sufficient for the scheme to import the corresponding CoRIM profile package, so that the profile gets registered, and the corim.go files here can be removed.

@abhiraj-ku abhiraj-ku force-pushed the refresh-corim-profiles branch 3 times, most recently from b29d634 to fd23c00 Compare April 1, 2026 13:23
@setrofim setrofim requested a review from thomas-fossati April 1, 2026 13:45
@abhiraj-ku abhiraj-ku force-pushed the refresh-corim-profiles branch 2 times, most recently from b265db6 to ecb1369 Compare April 1, 2026 14:30
Copy link
Copy Markdown
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

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

Thanks for all the work! I have left a couple of comments inline.

]
"sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg="
],
"name": "BL"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, add version too. (Here and below; also, for PSA.)

"value": "cca.platform-config"
},
"value": {
"raw-value": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to use separate codepoints to encode the raw value and the associated mask. However, https://www.ietf.org/archive/id/draft-ydb-rats-cca-endorsements-03.html#section-3.1.3.2 specifies a single codepoint for both, which is consistent with the deprecation of codepoint 5 in upstream CoRIM.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

should it be changed to match the draft’s single tagged-masked-raw-value representation?

Comment on lines +108 to +112
"raw-value": {
"type": "bytes",
"value": "AQID"
},
"raw-value-mask": "AQID"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

@yogeshbdeshpande
Copy link
Copy Markdown
Collaborator

@abhiraj-ku : I checked the scheme parsec-cca, still uses OLD Measurement and Implementation ID:

Please check: https://github.com/veraison/services/blob/main/scheme/parsec-cca/test/corim/src/comid-parsec-cca-refval.json

We need to fix this also, either here OR via a separate PR.

Copy link
Copy Markdown
Collaborator

@yogeshbdeshpande yogeshbdeshpande left a comment

Choose a reason for hiding this comment

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

Left some comments for you to look at!

},
"ear.veraison.policy-claims": {
"problem": "integrity validation failed: bad evidence: freshness: psa-nonce (414a7c174141b3d0e9a1d28af31520f0d42299feac4007ded89d68ae6cd92f19) does not match session nonce (75e69d6de79f75e69d6de79f75e69d6de79f75e69d6de79f75e69d6de79f75e6)"
"problem": "no trust anchor for evidence"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This does not seems correct to me, can you please double check, why this has been modified??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The error MUST be failure of Evidence Integrity due to mis-match of PSA Nonce.

"digests": [
"sha-256:BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg="
],
"name": "BL"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to apply the Version comment by checking all the test files

return false, false, err
}

// Not a platform-config entry. Treat any digest-bearing measurement as
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should check here for MKey corresponding to CCA SW Component and fail, if there is a mis-match in MKey value

encoded := base64.StdEncoding.EncodeToString((*measurement.Val.Digests)[0].HashValue)
referenceValues[encoded] = [2]string{*refValID.Label, *refValID.Version}
// Extract label (mtype) and version from measurement value
label := ""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This and line 487, can be best written as
var label, version string

@abhiraj-ku
Copy link
Copy Markdown
Author

@abhiraj-ku : I checked the scheme parsec-cca, still uses OLD Measurement and Implementation ID:

Please check: https://github.com/veraison/services/blob/main/scheme/parsec-cca/test/corim/src/comid-parsec-cca-refval.json

We need to fix this also, either here OR via a separate PR.

ARM CCA does the same model/thing and the same extraction and mapping pattern exists in ARM CCA and that class ID is exactly what implementation ID maps into during lookup in the json file you have referenced here

Migrate PSA-IoT and ARM-CCA scheme handling to latest profile APIs and string measurement keys.

Regenerate PSA and ARM-CCA CoRIM test vectors and update negative cases to match new profile validation behavior.

Signed-off-by: Abhishek kumar <abhirajabhi312@gmail.com>
@abhiraj-ku abhiraj-ku force-pushed the refresh-corim-profiles branch from ecb1369 to d4c39f7 Compare April 8, 2026 16:24
Copy link
Copy Markdown
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

As discussed, we will update veraison/corim to support $raw-value-type-choice and then return here with the necessary changes to ensure full alignment with the CCA profile.

🚢 it!

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.

4 participants