diff --git a/loader/src/main.rs b/loader/src/main.rs index 7265c8fcd..06b42b449 100644 --- a/loader/src/main.rs +++ b/loader/src/main.rs @@ -93,6 +93,9 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32) #[cfg(feature = "cramium-soc")] crate::platform::early_init(); // sets up PLLs so we're not running at 16MHz... + #[cfg(feature = "cramium-soc")] + crate::platform::process_update(); + // initially validate the whole image on disk (including kernel args) // kernel args must be validated because tampering with them can change critical assumptions about // how data is loaded into memory diff --git a/loader/src/platform/cramium/update.rs b/loader/src/platform/cramium/update.rs new file mode 100644 index 000000000..5aabce976 --- /dev/null +++ b/loader/src/platform/cramium/update.rs @@ -0,0 +1,9 @@ +/// Checks to see if the necessary conditions for an update are met +pub fn process_update() { + // Placeholder: + // Remember to lock the root keys before processing any updates + crate::platform::cramium::verifier::lifecycle_lock_root(); + { + // update code here + } +} diff --git a/loader/src/platform/cramium/verifier.rs b/loader/src/platform/cramium/verifier.rs new file mode 100644 index 000000000..f2cc70dff --- /dev/null +++ b/loader/src/platform/cramium/verifier.rs @@ -0,0 +1,4 @@ +pub fn lifecycle_lock_root() { + // placeholder to lock out access to root secrets due to the lifecycle being advanced past + // signature verification +}