Skip to content

Commit 7345bc9

Browse files
committed
fix: preserve GetQuote attestation compatibility after rebase
1 parent b953c66 commit 7345bc9

9 files changed

Lines changed: 21575 additions & 2 deletions

File tree

dstack/guest-agent-simulator/src/simulator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ pub fn simulated_quote_response(
3535
let Some(quote) = attestation.tdx_quote_bytes() else {
3636
return Err(anyhow!("Quote not found"));
3737
};
38+
let versioned = VersionedAttestation::V1 {
39+
attestation: attestation.clone(),
40+
}
41+
.to_bytes()?;
3842

3943
Ok(GetQuoteResponse {
4044
quote,
@@ -43,6 +47,7 @@ pub fn simulated_quote_response(
4347
.unwrap_or_default(),
4448
report_data: report_data.to_vec(),
4549
vm_config: vm_config.to_string(),
50+
attestation: versioned,
4651
event_log_ccel: Vec::new(),
4752
})
4853
}

dstack/guest-agent/rpc/proto/agent_rpc.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ message GetQuoteResponse {
234234
// V2: canonical JSON (UTF-8)
235235
//
236236
// Empty on platforms without an ACPI CCEL table (e.g. Nitro Enclaves).
237-
bytes event_log_ccel = 5;
237+
bytes attestation = 5;
238+
bytes event_log_ccel = 6;
238239
}
239240

240241
message EmitEventArgs {

dstack/guest-agent/src/backend.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,21 @@ impl PlatformBackend for RealPlatform {
5353
let tdx_quote = attestation.get_tdx_quote_bytes();
5454
let tdx_event_log = attestation.get_tdx_event_log_string(include_hash_inputs);
5555
let event_log_ccel = attestation.get_tdx_event_log_ccel().unwrap_or_default();
56+
let versioned = if tdx_quote.is_some() {
57+
Vec::new()
58+
} else {
59+
attestation
60+
.clone()
61+
.into_versioned()
62+
.to_bytes()
63+
.context("Failed to encode versioned attestation")?
64+
};
5665
Ok(GetQuoteResponse {
5766
quote: tdx_quote.unwrap_or_default(),
5867
event_log: tdx_event_log.unwrap_or_default(),
5968
report_data: report_data.to_vec(),
6069
vm_config: vm_config.to_string(),
70+
attestation: versioned,
6171
event_log_ccel,
6272
})
6373
}

dstack/kms/src/main_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ mod tests {
781781
}
782782

783783
fn runtime_event(event: &str, payload: Vec<u8>) -> RuntimeEvent {
784-
RuntimeEvent::new(event.to_string(), payload)
784+
RuntimeEvent::new(event.to_string(), payload, Default::default())
785785
}
786786

787787
fn verified_aws_nitro_tpm_attestation(

0 commit comments

Comments
 (0)