Skip to content

Commit d10dd2b

Browse files
yogeshbdeshpandejraman567
authored andcommitted
fix(sevsnp/evidence): fix error reporting in TCB comparion function
Add global variables to log errors in the compareTcb function Signed-off-by: Yogesh Deshpande <[email protected]> Signed-off-by: Jagannathan Raman <[email protected]>
1 parent 75c3337 commit d10dd2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scheme/sevsnp/evidence_handler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var (
3535
ErrNoProvisionedRV = errors.New("reference value unavailable for attester")
3636
ErrBadSigningKey = errors.New("bad signing key in attestation report")
3737
ErrMismatchedReportedTCB = errors.New("reported TCB in evidence doesn't match reference")
38+
ErrReferenceMissingSVN = errors.New("reference doesn't have SVN")
39+
ErrEvidenceMissingSVN = errors.New("evidence doesn't have SVN")
3840
)
3941

4042
const (
@@ -397,12 +399,12 @@ func compareMeasurements(refM comid.Measurement, evM comid.Measurement) bool {
397399

398400
func compareTcb(refM comid.Measurement, evM comid.Measurement) bool {
399401
if refM.Val.SVN == nil {
400-
log.Errorf("reference doesn't have SVN")
402+
log.Errorf("%w", ErrReferenceMissingSVN)
401403
return false
402404
}
403405

404406
if evM.Val.SVN == nil {
405-
log.Errorf("evidence doesn't have SVN")
407+
log.Errorf("%w", ErrEvidenceMissingSVN)
406408
return false
407409
}
408410

0 commit comments

Comments
 (0)