Skip to content
Closed
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
4 changes: 3 additions & 1 deletion integration-tests/utils/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ def generate_evidence(scheme, evidence, nonce, signing, outname):

if scheme == 'psa' and nonce:
claims_file = f'{GENDIR}/claims/{scheme}.{evidence}.json'
# convert nonce from base64url to base64
translated_nonce = nonce.replace('-', '+').replace('_', '/')
update_json(
f'data/claims/{scheme}.{evidence}.json',
{f'{scheme}-nonce': nonce},
{f'{scheme}-nonce': translated_nonce},
claims_file,
)
elif scheme == 'cca' and nonce:
Expand Down
10 changes: 9 additions & 1 deletion vts/trustedservices/trustedservices_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,21 @@ func (o *GRPC) GetAttestation(
return o.finalize(appraisal, err)
}

// Filter out empty reference IDs (can occur when no software components are provisioned)
filteredReferenceIDs := make([]string, 0, len(referenceIDs))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filtering shoudn't be necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

for _, refID := range referenceIDs {
if refID != "" {
filteredReferenceIDs = append(filteredReferenceIDs, refID)
}
}

appraisal.EvidenceContext.Evidence, err = structpb.NewStruct(claims)
if err != nil {
err = fmt.Errorf("unserializable claims in result: %w", err)
return o.finalize(appraisal, err)
}

appraisal.EvidenceContext.ReferenceIds = referenceIDs
appraisal.EvidenceContext.ReferenceIds = filteredReferenceIDs

o.logger.Debugw("constructed evidence context",
"software-id", appraisal.EvidenceContext.ReferenceIds,
Expand Down