mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
wire up the hash computation to the hash consumption
This commit is contained in:
parent
7719dbcb69
commit
7b8a598020
1 changed files with 7 additions and 5 deletions
|
|
@ -83,7 +83,9 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32)
|
||||||
// kernel args must be validated because tampering with them can change critical assumptions about
|
// kernel args must be validated because tampering with them can change critical assumptions about
|
||||||
// how data is loaded into memory
|
// how data is loaded into memory
|
||||||
#[cfg(feature = "secboot")]
|
#[cfg(feature = "secboot")]
|
||||||
if !secboot::validate_xous_img(signed_buffer as *const u32) {
|
let mut fs_prehash = [0u8; 64];
|
||||||
|
#[cfg(feature = "secboot")]
|
||||||
|
if !secboot::validate_xous_img(signed_buffer as *const u32, &mut fs_prehash) {
|
||||||
loop {}
|
loop {}
|
||||||
};
|
};
|
||||||
// the kernel arg buffer is SIG_BLOCK_SIZE into the signed region
|
// the kernel arg buffer is SIG_BLOCK_SIZE into the signed region
|
||||||
|
|
@ -95,10 +97,10 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32)
|
||||||
// But for now, the basic "validate everything as a blob" is perhaps good enough to
|
// But for now, the basic "validate everything as a blob" is perhaps good enough to
|
||||||
// armor code-at-rest against front-line patching attacks.
|
// armor code-at-rest against front-line patching attacks.
|
||||||
let kab = KernelArguments::new(arg_buffer);
|
let kab = KernelArguments::new(arg_buffer);
|
||||||
boot_sequence(kab, signature);
|
boot_sequence(kab, signature, fs_prehash);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
fn boot_sequence(args: KernelArguments, _signature: u32, fs_prehash: [u8; 64]) -> ! {
|
||||||
// Store the initial boot config on the stack. We don't know
|
// Store the initial boot config on the stack. We don't know
|
||||||
// where in heap this memory will go.
|
// where in heap this memory will go.
|
||||||
#[allow(clippy::cast_ptr_alignment)] // This test only works on 32-bit systems
|
#[allow(clippy::cast_ptr_alignment)] // This test only works on 32-bit systems
|
||||||
|
|
@ -124,7 +126,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
||||||
#[cfg(not(feature = "simulation-only"))]
|
#[cfg(not(feature = "simulation-only"))]
|
||||||
clear_ram(&mut cfg);
|
clear_ram(&mut cfg);
|
||||||
phase_1(&mut cfg);
|
phase_1(&mut cfg);
|
||||||
phase_2(&mut cfg);
|
phase_2(&mut cfg, &fs_prehash);
|
||||||
#[cfg(feature = "debug-print")]
|
#[cfg(feature = "debug-print")]
|
||||||
if VDBG {
|
if VDBG {
|
||||||
check_load(&mut cfg);
|
check_load(&mut cfg);
|
||||||
|
|
@ -138,7 +140,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! {
|
||||||
println!("No suspend marker found, doing a cold boot!");
|
println!("No suspend marker found, doing a cold boot!");
|
||||||
clear_ram(&mut cfg);
|
clear_ram(&mut cfg);
|
||||||
phase_1(&mut cfg);
|
phase_1(&mut cfg);
|
||||||
phase_2(&mut cfg);
|
phase_2(&mut cfg, &fs_prehash);
|
||||||
#[cfg(feature = "debug-print")]
|
#[cfg(feature = "debug-print")]
|
||||||
if VDBG {
|
if VDBG {
|
||||||
check_load(&mut cfg);
|
check_load(&mut cfg);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue