From 42fa0d3d174c46304cccbfe1aab91348e8ef45b4 Mon Sep 17 00:00:00 2001 From: Thomas Fossati Date: Wed, 28 Aug 2024 12:06:59 +0200 Subject: [PATCH] fix(scheme): handle the case when no platform configuration RV is given Signed-off-by: Thomas Fossati --- scheme/common/arm/handlers.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scheme/common/arm/handlers.go b/scheme/common/arm/handlers.go index 2f0cdaac..13061e48 100644 --- a/scheme/common/arm/handlers.go +++ b/scheme/common/arm/handlers.go @@ -182,8 +182,17 @@ func MatchPlatformConfig(scheme string, evidence psatoken.IClaims, endorsements if err != nil { return false } - if len(endorsements) > 1 { - log.Errorf("got %d CCA configuration endorsements, want 1", len(endorsements)) + + endorsementsLen := len(endorsements) + + switch endorsementsLen { + case 0: + log.Debugf("got no CCA configuration endorsement, accepting unconditionally") + return true + case 1: + break + default: + log.Errorf("got %d CCA configuration endorsements, want 1", endorsementsLen) return false }