sim: get status area size from bootutil
Add new bootutil function that returns the size of the status area.
The simulator was updated to remove the custom calculation and get
the size directly from bootutil, avoiding breakages the happen when
both are not in sync.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/src/image.rs b/sim/src/image.rs
index 8d6fb91..b7f8ed6 100644
--- a/sim/src/image.rs
+++ b/sim/src/image.rs
@@ -657,19 +657,11 @@
}
fn trailer_sz(&self, align: usize) -> usize {
- c::boot_trailer_sz(align as u8) as usize
+ c::boot_trailer_sz(align as u32) as usize
}
- // FIXME: could get status sz from bootloader
fn status_sz(&self, align: usize) -> usize {
- let bias = if Caps::EncRsa.present() || Caps::EncKw.present() ||
- Caps::EncEc256.present() {
- 32
- } else {
- 0
- };
-
- self.trailer_sz(align) - (16 + 32 + bias)
+ c::boot_status_sz(align as u32) as usize
}
/// This test runs a simple upgrade with no fails in the images, but