Skip to content

Commit

Permalink
fix(scheme): handle the case when no platform configuration RV is given
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Fossati <[email protected]>
  • Loading branch information
thomas-fossati committed Aug 28, 2024
1 parent 4f50718 commit 42fa0d3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scheme/common/arm/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 42fa0d3

Please sign in to comment.