Skip to content
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

CCA realm appraisal fix #266

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion provisioning/api/handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023 Contributors to the Veraison project.
// Copyright 2022-2024 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package api

Expand Down
2 changes: 1 addition & 1 deletion provisioning/provisioner/provisioner.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023 Contributors to the Veraison project.
// Copyright 2022-2024 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0

package provisioner
Expand Down
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
Loading