Skip to content

Commit 193c7ed

Browse files
committed
fix(sevsnp): skip unused claims
Some claims in the SEV-SNP profile aren't relevant for verification, so skipping them Signed-off-by: Jagannathan Raman <[email protected]>
1 parent dd7b214 commit 193c7ed

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

scheme/sevsnp/evidence_handler.go

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,28 @@ claimsLoop:
449449
break
450450
}
451451

452-
// REPORT_ID is ephemeral, so we can't use it for verification.
453-
// REPORT_DATA is client-supplied , which we aren't using for
454-
// verification in this scheme.
455-
if k == mKeyReportData || k == mKeyReportID {
452+
// We can skip validating certain claims for the following reasons:
453+
// - POLICY ToDo: Do we need to test individual policy features?
454+
// - CURRENT_TCB is informational only. It's best handled by policy
455+
// - PLATFORM_INFO ToDO: Do we need to test individual platform features?
456+
// - REPORT_DATA is a nonce supplied by user for freshness, not applicable for verification
457+
// - REPORT_ID is ephemeral, so we can't use it for verification.
458+
// - REPORT_ID_MA is also ephemeral, used for migration
459+
// - CHIP_ID is unique to an specific attester, but reference values could be used more generally
460+
// - Current Version (CURRENT_MAJOR/MINOR/BUILD) should already be part of REPORTED_TCB.
461+
// ToDo: It is a good idea to test it anyway, but the Version type only tests for
462+
// equality, and this would trigger spurious failures
463+
// - COMMITTED_TCB is informational, used by the host to advance REPORTED_TCB
464+
if k == mKeyPolicy ||
465+
k == mKeyCurrentTcb ||
466+
k == mKeyPlatformInfo ||
467+
k == mKeyReportData ||
468+
k == mKeyReportID ||
469+
k == mKeyReportIDMA ||
470+
k == mKeyChipID ||
471+
k == mKeyCommittedTcb ||
472+
k == mKeyCurrentVersion ||
473+
k == mKeyCommittedVersion {
456474
continue
457475
}
458476

@@ -472,6 +490,15 @@ claimsLoop:
472490
err = fmt.Errorf("reported TCB in evidence doesn't match reference")
473491
break claimsLoop
474492
}
493+
case mKeyLaunchTcb:
494+
reportedTcb, err := measurementByUintKey(*evidence, mKeyReportedTcb)
495+
if err != nil {
496+
break claimsLoop
497+
}
498+
if !compareTcb(*reportedTcb, *em) {
499+
// ToDo: Is this a failure condition?
500+
log.Errorf("TEE launched with older TCB version")
501+
}
475502
default:
476503
if !compareMeasurements(m, *em) {
477504
err = fmt.Errorf("MKey %d in reference value doesn't match with evidence", k)

scheme/sevsnp/scheme.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,17 @@ var (
2626
)
2727

2828
const (
29-
mKeyReportData = 640
30-
mKeyMeasurement = 641
31-
mKeyReportID = 645
32-
mKeyReportedTcb = 647
29+
mKeyPolicy = 2
30+
mKeyCurrentTcb = 6
31+
mKeyPlatformInfo = 7
32+
mKeyReportData = 640
33+
mKeyMeasurement = 641
34+
mKeyReportID = 645
35+
mKeyReportIDMA = 646
36+
mKeyReportedTcb = 647
37+
mKeyChipID = 3328
38+
mKeyCommittedTcb = 3329
39+
mKeyCurrentVersion = 3330
40+
mKeyCommittedVersion = 3936
41+
mKeyLaunchTcb = 3968
3342
)

0 commit comments

Comments
 (0)