add stubs for lifecycle management and update checking in loader

this is just a reminder to me on how i was planning to implement
this after going through a big side-quest to change other things.
This commit is contained in:
bunnie 2024-10-01 23:15:54 +08:00
parent 6eca732043
commit 59b15541f3
3 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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
}
}

View file

@ -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
}