Commit ebdc9697 authored by Fabio Utzig's avatar Fabio Utzig Committed by David Brown
Browse files

Add MCUBOOT_VALIDATE_SLOT0 as feature

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 43685c21
Loading
Loading
Loading
Loading
+1
Changes for sim/Cargo.toml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ default = []
sig-rsa = ["mcuboot-sys/sig-rsa"]
sig-ecdsa = ["mcuboot-sys/sig-ecdsa"]
overwrite-only = ["mcuboot-sys/overwrite-only"]
validate-slot0 = ["mcuboot-sys/validate-slot0"]

[build-dependencies]
gcc = "0.3.54"
+3
Changes for sim/mcuboot-sys/Cargo.toml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ sig-ecdsa = []
# Overwrite only upgrade
overwrite-only = []

# Disable validation of slot0
validate-slot0 = []

[build-dependencies]
gcc = "0.3.54"

+4
Changes for sim/mcuboot-sys/build.rs: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,11 +12,15 @@ fn main() {
    let sig_rsa = env::var("CARGO_FEATURE_SIG_RSA").is_ok();
    let sig_ecdsa = env::var("CARGO_FEATURE_SIG_ECDSA").is_ok();
    let overwrite_only = env::var("CARGO_FEATURE_OVERWRITE_ONLY").is_ok();
    let validate_slot0 = env::var("CARGO_FEATURE_VALIDATE_SLOT0").is_ok();

    let mut conf = gcc::Build::new();
    conf.define("__BOOTSIM__", None);
    conf.define("MCUBOOT_USE_FLASH_AREA_GET_SECTORS", None);

    if validate_slot0 {
        conf.define("MCUBOOT_VALIDATE_SLOT0", None);
    }

    // Currently, mbed TLS cannot build with both RSA and ECDSA.
    if sig_rsa && sig_ecdsa {