sim: Reduce most false failures due to ECDSA size change
The encoding of ECDSA signatures is variable sized. Better support this
by allowing the TLV size estimate to be off by as much as 6, but only in
the case of ECDSA signature.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/caps.rs b/sim/src/caps.rs
index a0d08b7..32feba5 100644
--- a/sim/src/caps.rs
+++ b/sim/src/caps.rs
@@ -36,6 +36,11 @@
(caps as u32) & (self as u32) != 0
}
+ /// Does this build have ECDSA of some type enabled for signatures.
+ pub fn has_ecdsa() -> bool {
+ Caps::EcdsaP256.present() || Caps::EcdsaP224.present()
+ }
+
/// Query for the number of images that have been configured into this
/// MCUboot build.
pub fn get_num_images() -> usize {