MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / simulated_quote_response

Function simulated_quote_response

guest-agent-simulator/src/simulator.rs:27–44  ·  view source on GitHub ↗
(
    attestation: &VersionedAttestation,
    report_data: [u8; 64],
    vm_config: &str,
    patch_report_data: bool,
)

Source from the content-addressed store, hash-verified

25}
26
27pub fn simulated_quote_response(
28 attestation: &VersionedAttestation,
29 report_data: [u8; 64],
30 vm_config: &str,
31 patch_report_data: bool,
32) -> Result<GetQuoteResponse> {
33 let attestation = maybe_patch_report_data(attestation, report_data, patch_report_data, "quote");
34 let Some(quote) = attestation.tdx_quote_bytes() else {
35 return Err(anyhow!("Quote not found"));
36 };
37
38 Ok(GetQuoteResponse {
39 quote,
40 event_log: attestation.tdx_event_log_string().unwrap_or_default(),
41 report_data: report_data.to_vec(),
42 vm_config: vm_config.to_string(),
43 })
44}
45
46pub fn simulated_attest_response(
47 attestation: &VersionedAttestation,

Callers 1

quote_responseMethod · 0.85

Calls 4

maybe_patch_report_dataFunction · 0.85
tdx_quote_bytesMethod · 0.80
tdx_event_log_stringMethod · 0.80
to_vecMethod · 0.80

Tested by

no test coverage detected