(
&self,
vm_config: String,
attestation: &VerifiedAttestation,
debug: bool,
details: &mut VerificationDetails,
)
| 488 | } |
| 489 | |
| 490 | pub async fn verify_os_image_hash( |
| 491 | &self, |
| 492 | vm_config: String, |
| 493 | attestation: &VerifiedAttestation, |
| 494 | debug: bool, |
| 495 | details: &mut VerificationDetails, |
| 496 | ) -> Result<VmConfig> { |
| 497 | let vm_config = attestation |
| 498 | .decode_vm_config(&vm_config) |
| 499 | .context("Failed to decode VM config")?; |
| 500 | match &attestation.quote { |
| 501 | AttestationQuote::DstackTdx(_) => { |
| 502 | self.verify_os_image_hash_for_dstack_tdx(&vm_config, attestation, debug, details) |
| 503 | .await?; |
| 504 | } |
| 505 | AttestationQuote::DstackGcpTdx | AttestationQuote::DstackNitroEnclave => { |
| 506 | bail!( |
| 507 | "Unsupported attestation quote: {:?}", |
| 508 | attestation.quote.mode() |
| 509 | ); |
| 510 | } |
| 511 | } |
| 512 | Ok(vm_config) |
| 513 | } |
| 514 | |
| 515 | async fn verify_os_image_hash_for_dstack_tdx( |
| 516 | &self, |
no test coverage detected