Skip to content

Commit 4943289

Browse files
committed
fix(guest): skip TDX config check on Nitro Enclave
1 parent 2f31e86 commit 4943289

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

dstack/dstack-util/src/system_setup/config_id_verifier.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ fn verify_mr_config_id_for_mode(mode: TeeVariant, local: LocalMrConfigValues<'_>
9494
// in measure_app_info); there is no host-supplied claim to cross-check.
9595
// The key_provider_id pin is enforced by verify_key_provider_id.
9696
TeeVariant::DstackAwsNitroTpm => Ok(()),
97+
// Nitro Enclave binds the image through the signed NSM document and
98+
// the app ID through its runtime event. It has no TDX mr_config_id.
99+
TeeVariant::DstackNitroEnclave => Ok(()),
97100
_ => verify_tdx_mr_config_id(local),
98101
}
99102
}
@@ -438,4 +441,23 @@ mod tests {
438441
};
439442
verify_mr_config_v3_document(&document.to_string(), local_with_script).unwrap();
440443
}
444+
445+
#[test]
446+
fn nitro_enclave_does_not_require_tdx_mr_config() -> Result<()> {
447+
let compose_hash = [0u8; 32];
448+
let gpu_policy_hash = [0u8; 32];
449+
let app_id = [0u8; 20];
450+
let instance_id = [0u8; 20];
451+
let local = LocalMrConfigValues {
452+
compose_hash: &compose_hash,
453+
gpu_policy_hash: &gpu_policy_hash,
454+
init_script_hashes: &[],
455+
app_id: &app_id,
456+
instance_id: &instance_id,
457+
key_provider: KeyProviderKind::None,
458+
key_provider_id: &[],
459+
};
460+
461+
verify_mr_config_id_for_mode(TeeVariant::DstackNitroEnclave, local)
462+
}
441463
}

0 commit comments

Comments
 (0)