Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
vbalain committed Dec 27, 2023
1 parent 3b7c3cf commit 1a97b02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/attest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func TestHardwareAttestationPass(t *testing.T) {
teetech string
wanterr string
}{
{"TdxPass", "1234", "tdx", "failed to open tdx device"},
{"TdxPass", "1234", "tdx", "failed to create tdx quote provider"},
{"SevSnpPass", "1234", "sev-snp", "failed to open sev-snp device"},
}
for _, op := range tests {
Expand Down
2 changes: 1 addition & 1 deletion cmd/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestHwAttestationPass(t *testing.T) {
teetech string
wanterr string
}{
{"TdxPass", "1234", "tdx", "failed to open tdx device"},
{"TdxPass", "1234", "tdx", "failed to create tdx quote provider"},
{"SevSnpPass", "1234", "sev-snp", "failed to open sev-snp device"},
}
for _, op := range tests {
Expand Down
9 changes: 6 additions & 3 deletions server/verify_tdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ func TdxDefaultOptions() *VerifyTdxOpts {
}
}

// VerifyTdxAttestation checks that the TDX attestation quote is valid
func VerifyTdxAttestation(attestation any, opts *VerifyTdxOpts) error {
// VerifyTdxAttestation checks that the TDX attestation quote is valid. The TEE-specific attestation
// quote is extracted from the Attestation protobuf. At a granular level, this quote is fetched via
// go-tdx-guest's GetQuote client API.
// Supported quote formats - QuoteV4.
func VerifyTdxAttestation(tdxAttestationQuote any, opts *VerifyTdxOpts) error {
// Check that the quote contains valid signature and certificates. Do not check revocations.
return tv.TdxQuote(attestation, opts.Verification)
return tv.TdxQuote(tdxAttestationQuote, opts.Verification)
}

0 comments on commit 1a97b02

Please sign in to comment.