Enable bootstrap test in CI
Adds testing a bootstrap with RSA/ECDSA signing and KW encryption.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/.travis.yml b/.travis.yml
index 225641e..a18bfb8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,7 +9,7 @@
# Runs each value defined in $SINGLE_FEATURES by itself in the order
# the were defined.
- os: linux
- env: SINGLE_FEATURES="sig-ecdsa enc-kw"
+ env: SINGLE_FEATURES="sig-ecdsa enc-kw bootstrap"
- os: linux
env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-slot0"
- os: linux
@@ -27,6 +27,8 @@
env: MULTI_FEATURES="enc-kw overwrite-only,enc-rsa overwrite-only"
- os: linux
env: MULTI_FEATURES="sig-rsa enc-rsa validate-slot0"
+ - os: linux
+ env: MULTI_FEATURES="sig-rsa enc-kw validate-slot0 bootstrap"
# FIXME: this test actually fails and must be fixed
#- os: linux
diff --git a/sim/Cargo.toml b/sim/Cargo.toml
index fe3087e..c70ac0f 100644
--- a/sim/Cargo.toml
+++ b/sim/Cargo.toml
@@ -12,6 +12,7 @@
validate-slot0 = ["mcuboot-sys/validate-slot0"]
enc-rsa = ["mcuboot-sys/enc-rsa"]
enc-kw = ["mcuboot-sys/enc-kw"]
+bootstrap = ["mcuboot-sys/bootstrap"]
[dependencies]
libc = "0.2.0"
diff --git a/sim/mcuboot-sys/Cargo.toml b/sim/mcuboot-sys/Cargo.toml
index 09b323b..16cc8d5 100644
--- a/sim/mcuboot-sys/Cargo.toml
+++ b/sim/mcuboot-sys/Cargo.toml
@@ -29,6 +29,9 @@
# Encrypt image in slot1 using AES-KW-128
enc-kw = []
+# Allow bootstrapping an empty/invalid slot0 from a valid slot1
+bootstrap = []
+
[build-dependencies]
cc = "1.0.25"
diff --git a/sim/mcuboot-sys/build.rs b/sim/mcuboot-sys/build.rs
index c959bb2..12377db 100644
--- a/sim/mcuboot-sys/build.rs
+++ b/sim/mcuboot-sys/build.rs
@@ -15,6 +15,7 @@
let validate_slot0 = env::var("CARGO_FEATURE_VALIDATE_SLOT0").is_ok();
let enc_rsa = env::var("CARGO_FEATURE_ENC_RSA").is_ok();
let enc_kw = env::var("CARGO_FEATURE_ENC_KW").is_ok();
+ let bootstrap = env::var("CARGO_FEATURE_BOOTSTRAP").is_ok();
let mut conf = cc::Build::new();
conf.define("__BOOTSIM__", None);
@@ -23,6 +24,10 @@
conf.define("MCUBOOT_HAVE_ASSERT_H", None);
conf.define("MCUBOOT_MAX_IMG_SECTORS", Some("128"));
+ if bootstrap {
+ conf.define("MCUBOOT_BOOTSTRAP", None);
+ }
+
if validate_slot0 {
conf.define("MCUBOOT_VALIDATE_SLOT0", None);
}