Skip to content

Commit

Permalink
fix(scheme): allow CCA plaform-only verifier
Browse files Browse the repository at this point in the history
Do not return an overall warning status if no realm reference values have been
provisioned.  Instead, return "no claims".

Fix #265

Signed-off-by: Thomas Fossati <[email protected]>
  • Loading branch information
thomas-fossati committed Sep 3, 2024
1 parent e8e7666 commit 458b416
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 2 additions & 3 deletions scheme/arm-cca/evidence_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ func Test_AppraiseEvidence_Realm(t *testing.T) { // nolint: dupl
{
desc: "No realm endorsements",
input: "test/realm/no-realm-endorsements.json",
expectedStatus: ear.TrustTierWarning,
expectedExec: ear.UnrecognizedRuntimeClaim,
expectedStatus: ear.TrustTierNone,
expectedExec: ear.NoClaim,
},

{
desc: "No matching rim measurements",
input: "test/realm/rim-mismatch-endorsements.json",
Expand Down
13 changes: 12 additions & 1 deletion scheme/arm-cca/realm.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ func realmAppraisal(
// If crypto verification (including chaining) completes correctly,
// we can safely assume the Realm instance to be trustworthy
trustVector.InstanceIdentity = ear.TrustworthyInstanceClaim
trustVector.Executables = ear.UnrecognizedRuntimeClaim
// By default, make no claims with regard to realm executables (i.e., RIM,
// PV and REMs). This is to support a platform-only CCA verifier.
// If we have been provisioned with realm executable reference values, they
// will be checked in the loop below and the trust vector updated accordingly.
trustVector.Executables = ear.NoClaim

partial := true
for _, endorsement := range realmEndorsements {
if matchRim(claims, &endorsement) {
partial = false
err := matchRpv(claims, &endorsement)
switch err {
// Note, If an Endorser does not use RPV it indicates, one Realm per RIM, which is a match
Expand Down Expand Up @@ -74,6 +80,11 @@ func realmAppraisal(
}

appraisal.UpdateStatusFromTrustVector()
// This is a kludge to work around EAR inability to express "partial" verification semantics.
if *appraisal.Status == ear.TrustTierAffirming && partial {
noClaimStatus := ear.TrustTierNone
appraisal.Status = &noClaimStatus
}
appraisal.VeraisonAnnotatedEvidence = &claimsMap

return &appraisal, nil
Expand Down

0 comments on commit 458b416

Please sign in to comment.