Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tdx rtmr for test purpose #509

Draft
wants to merge 1 commit into
base: tdx_rtmr
Choose a base branch
from
Draft
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: 4 additions & 0 deletions launcher/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ func (t *tdxAttestRoot) Attest(nonce []byte) (any, error) {
var tdxNonce [tlabi.TdReportDataSize]byte
copy(tdxNonce[:], nonce)

if err := os.WriteFile("/tmp/container_launcher/tdxnonce", tdxNonce[:], 0644); err != nil {
log.Printf("failed to write tdx nonce: %v", err)
}

rawQuote, err := tg.GetRawQuote(t.qp, tdxNonce)
if err != nil {
return nil, err
Expand Down
14 changes: 14 additions & 0 deletions verifier/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/base64"
"fmt"
"log"
"os"
"strings"

sabi "github.com/google/go-sev-guest/abi"
Expand Down Expand Up @@ -244,6 +245,19 @@ func convertRequestToREST(request verifier.VerifyAttestationRequest) *confidenti
CanonicalEventLog: request.TDCCELAttestation.CanonicalEventLog,
},
}

if err := os.WriteFile("/tmp/container_launcher/tdquote", request.TDCCELAttestation.TdQuote, 0644); err != nil {
log.Printf("failed to write tdquote to file: %v", err)
}
if err := os.WriteFile("/tmp/container_launcher/acpitable", request.TDCCELAttestation.CcelAcpiTable, 0644); err != nil {
log.Printf("failed to write tdquote to file: %v", err)
}
if err := os.WriteFile("/tmp/container_launcher/cceldata", request.TDCCELAttestation.CcelData, 0644); err != nil {
log.Printf("failed to write tdquote to file: %v", err)
}
if err := os.WriteFile("/tmp/container_launcher/cel", request.TDCCELAttestation.CanonicalEventLog, 0644); err != nil {
log.Printf("failed to write tdquote to file: %v", err)
}
}

return verifyReq
Expand Down
Loading