Skip to content

Commit

Permalink
Commiting intermittent work
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Nov 30, 2023
1 parent dec86fa commit 4b334b8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 0 additions & 2 deletions scheme/cca-realm/evidence_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,5 @@ func populateAttestationResult(
}
appraisal.UpdateStatusFromTrustVector()

appraisal.VeraisonAnnotatedEvidence = &evidence

return nil
}
8 changes: 8 additions & 0 deletions vts/appraisal/appraisal.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ func (o *Appraisal) InitPolicyID() {
submod.AppraisalPolicyID = &policyID
}
}

func (o *Appraisal) Update(apr *Appraisal) (*Appraisal, error) {
for key, submod := range apr.Result.Submods {
o.Result.Submods[key] = submod
}

return o, nil
}
18 changes: 17 additions & 1 deletion vts/trustedservices/trustedservices_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,23 @@ func (o *GRPC) GetAttestation(

mediaType := token.MediaType
requireAttestation := true
var overallAppraisal *appraisal.Appraisal

for requireAttestation {
appraisal, err := o.getPerSchemeAttestation(ctx, mediaType, token)
if err != nil {
return o.finalize(appraisal, err)
}
if overallAppraisal == nil {
overallAppraisal = appraisal
} else {
// Note we can just append subModule here, however for the now, entire Appraisal is passed
overallAppraisal, err = overallAppraisal.Update(appraisal)
if err != nil {
return o.finalize(overallAppraisal, err)
}
}

o.logger.Infow("Yogesh: Attestation Scheme =", "AS", appraisal.Scheme)
ar := appraisal.Result

Expand All @@ -422,7 +433,12 @@ func (o *GRPC) GetAttestation(
mediaType = *ar.UpMediaType
o.logger.Infow("Yogesh: Extracted MediaType=", "EC MT", mediaType)
} else {
o.logger.Infow("evaluated attestation result", "attestation-result", appraisal.Result)
// o.logger.Infow("evaluated attestation result", "attestation-result", overallAppraisal.Result)
for key, submod := range overallAppraisal.Result.Submods {
o.logger.Infow("evaluated sub mod", "key=", key, "value=", submod)
//o.Result.Submods[key] = submod
}

requireAttestation = false
return o.finalize(appraisal, err)
}
Expand Down

0 comments on commit 4b334b8

Please sign in to comment.