pvmfw: Delay panicking when DICE chain missing
Replace the low-level assertions during config data parsing about the
DICE handover being present with a high-level panic in main(), to
prepare for a change adding support for a missing input DICE handover.
Note: No functional change intended.
Test: m pvmfw
Bug: 393977894
Change-Id: I382e42c1eac8280a49aeca76d329bb8f5a10d07d
diff --git a/guest/pvmfw/src/config.rs b/guest/pvmfw/src/config.rs
index 1f9eacf..a16da35 100644
--- a/guest/pvmfw/src/config.rs
+++ b/guest/pvmfw/src/config.rs
@@ -141,7 +141,7 @@
#[derive(Default)]
pub struct Entries<'a> {
- pub dice_handover: &'a mut [u8],
+ pub dice_handover: Option<&'a mut [u8]>,
pub debug_policy: Option<&'a [u8]>,
pub vm_dtbo: Option<&'a mut [u8]>,
pub vm_ref_dt: Option<&'a [u8]>,
@@ -295,9 +295,6 @@
}
let [dice_handover, debug_policy, vm_dtbo, vm_ref_dt] = entries;
- // The platform DICE handover has always been required.
- let dice_handover = dice_handover.unwrap();
-
// We have no reason to mutate so drop the `mut`.
let debug_policy = debug_policy.map(|x| &*x);
let vm_ref_dt = vm_ref_dt.map(|x| &*x);