(
&self,
att: &VerifiedAttestation,
is_kms: bool,
use_boottime_mr: bool,
vm_config_str: &str,
)
| 245 | } |
| 246 | |
| 247 | async fn ensure_app_attestation_allowed( |
| 248 | &self, |
| 249 | att: &VerifiedAttestation, |
| 250 | is_kms: bool, |
| 251 | use_boottime_mr: bool, |
| 252 | vm_config_str: &str, |
| 253 | ) -> Result<BootConfig> { |
| 254 | let boot_info = build_boot_info(att, use_boottime_mr, vm_config_str)?; |
| 255 | let response = self |
| 256 | .state |
| 257 | .config |
| 258 | .auth_api |
| 259 | .is_app_allowed(&boot_info, is_kms) |
| 260 | .await?; |
| 261 | if !response.is_allowed { |
| 262 | bail!("Boot denied: {}", response.reason); |
| 263 | } |
| 264 | self.verify_os_image_hash(vm_config_str.into(), att) |
| 265 | .await |
| 266 | .context("Failed to verify os image hash")?; |
| 267 | Ok(BootConfig { |
| 268 | boot_info, |
| 269 | gateway_app_id: response.gateway_app_id, |
| 270 | }) |
| 271 | } |
| 272 | |
| 273 | fn derive_app_ca(&self, app_id: &[u8]) -> Result<CaCert> { |
| 274 | let context_data = vec![app_id, b"app-ca"]; |
no test coverage detected