Skip to content

Commit 95f5ef4

Browse files
committed
fix: skip empty reference value IDs in TrustedServices.GetAttestation
Fixes veraison#42. When attestation schemes return empty reference value IDs, the GetAttestation method now skips them before calling kvstore.Get() to avoid 'the supplied key is empty' errors. This commonly occurs when no software components are provisioned in trust anchors, causing handlers to return []string{""} for missing software reference IDs. Signed-off-by: Kallal Mukherjee <[email protected]>
1 parent 9c5b036 commit 95f5ef4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vts/trustedservices/trustedservices_grpc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,11 @@ func (o *GRPC) GetAttestation(
442442

443443
var multEndorsements []string
444444
for _, refvalID := range appraisal.EvidenceContext.ReferenceIds {
445+
// Skip empty reference IDs (can occur when no software components are provisioned)
446+
if refvalID == "" {
447+
o.logger.Debugw("skipping empty reference ID", "refvalID", refvalID)
448+
continue
449+
}
445450

446451
endorsements, err := o.EnStore.Get(refvalID)
447452
if err != nil && !errors.Is(err, kvstore.ErrKeyNotFound) {

0 commit comments

Comments
 (0)