mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
remove the developer function from the function code list
The developer function was decided to be overly-broad: the issue is you could slot that in to *any* boot position and it'd be accepted, and we already have a mechanism to deal with developer mode (developer-signed images). Thus eliminate the extra case and simplify the code base to reduce potential bugs.
This commit is contained in:
parent
391927139a
commit
36b103ef6c
3 changed files with 5 additions and 19 deletions
|
|
@ -68,11 +68,7 @@ pub const BOOT0_TO_BOOT1: SecurityConfiguration = SecurityConfiguration {
|
||||||
image_ptr: crate::BOOT1_START as *const u32,
|
image_ptr: crate::BOOT1_START as *const u32,
|
||||||
pubkey_ptr: crate::BOOT0_START as *const u32,
|
pubkey_ptr: crate::BOOT0_START as *const u32,
|
||||||
revocation_owc: crate::BOOT0_REVOCATION_OFFSET,
|
revocation_owc: crate::BOOT0_REVOCATION_OFFSET,
|
||||||
function_codes: &[
|
function_codes: &[FunctionCode::Boot1 as u32, FunctionCode::UpdatedBoot1 as u32],
|
||||||
FunctionCode::Boot1 as u32,
|
|
||||||
FunctionCode::UpdatedBoot1 as u32,
|
|
||||||
FunctionCode::Developer as u32,
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This is different from a jump directly to loader/baremetal because the
|
/// This is different from a jump directly to loader/baremetal because the
|
||||||
|
|
@ -81,11 +77,7 @@ pub const BOOT0_TO_ALTBOOT1: SecurityConfiguration = SecurityConfiguration {
|
||||||
image_ptr: crate::LOADER_START as *const u32,
|
image_ptr: crate::LOADER_START as *const u32,
|
||||||
pubkey_ptr: crate::BOOT0_START as *const u32,
|
pubkey_ptr: crate::BOOT0_START as *const u32,
|
||||||
revocation_owc: crate::BOOT0_REVOCATION_OFFSET,
|
revocation_owc: crate::BOOT0_REVOCATION_OFFSET,
|
||||||
function_codes: &[
|
function_codes: &[FunctionCode::Boot1 as u32, FunctionCode::UpdatedBoot1 as u32],
|
||||||
FunctionCode::Boot1 as u32,
|
|
||||||
FunctionCode::UpdatedBoot1 as u32,
|
|
||||||
FunctionCode::Developer as u32,
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const BOOT1_TO_LOADER_OR_BAREMETAL: SecurityConfiguration = SecurityConfiguration {
|
pub const BOOT1_TO_LOADER_OR_BAREMETAL: SecurityConfiguration = SecurityConfiguration {
|
||||||
|
|
@ -97,7 +89,6 @@ pub const BOOT1_TO_LOADER_OR_BAREMETAL: SecurityConfiguration = SecurityConfigur
|
||||||
FunctionCode::UpdatedBaremetal as u32,
|
FunctionCode::UpdatedBaremetal as u32,
|
||||||
FunctionCode::Loader as u32,
|
FunctionCode::Loader as u32,
|
||||||
FunctionCode::UpdatedLoader as u32,
|
FunctionCode::UpdatedLoader as u32,
|
||||||
FunctionCode::Developer as u32,
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -105,11 +96,7 @@ pub const LOADER_TO_KERNEL: SecurityConfiguration = SecurityConfiguration {
|
||||||
image_ptr: crate::KERNEL_START as *const u32,
|
image_ptr: crate::KERNEL_START as *const u32,
|
||||||
pubkey_ptr: crate::LOADER_START as *const u32,
|
pubkey_ptr: crate::LOADER_START as *const u32,
|
||||||
revocation_owc: crate::LOADER_REVOCATION_OFFSET,
|
revocation_owc: crate::LOADER_REVOCATION_OFFSET,
|
||||||
function_codes: &[
|
function_codes: &[FunctionCode::Kernel as u32, FunctionCode::UpdatedKernel as u32],
|
||||||
FunctionCode::Kernel as u32,
|
|
||||||
FunctionCode::UpdatedKernel as u32,
|
|
||||||
FunctionCode::Developer as u32,
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const LOADER_TO_DETACHED_APP: SecurityConfiguration = SecurityConfiguration {
|
pub const LOADER_TO_DETACHED_APP: SecurityConfiguration = SecurityConfiguration {
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ pub enum FunctionCode {
|
||||||
/// Application region
|
/// Application region
|
||||||
App = 0x10_0000,
|
App = 0x10_0000,
|
||||||
UpdatedApp = 0x10_0001,
|
UpdatedApp = 0x10_0001,
|
||||||
/// Developer use - can go in any region, but only usable with secrets wiped.
|
|
||||||
Developer = 0x1000_0000,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const BAOCHIP_SIG_VERSION: u32 = 0x1_00;
|
pub const BAOCHIP_SIG_VERSION: u32 = 0x1_00;
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,8 @@ pub fn sign_image(
|
||||||
Some("kernel") => FunctionCode::Kernel,
|
Some("kernel") => FunctionCode::Kernel,
|
||||||
Some("app") => FunctionCode::App,
|
Some("app") => FunctionCode::App,
|
||||||
Some("swap") => FunctionCode::Swap,
|
Some("swap") => FunctionCode::Swap,
|
||||||
_ => FunctionCode::Developer,
|
Some("baremetal") => FunctionCode::Baremetal,
|
||||||
|
_ => panic!("Invalid function code"),
|
||||||
};
|
};
|
||||||
let mut header = SignatureInFlash::default();
|
let mut header = SignatureInFlash::default();
|
||||||
header.sealed_data.version = version as u32;
|
header.sealed_data.version = version as u32;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue