Fix ECDSA Zephyr configuration of mbed TLS
The Zephyr configuration was enabling the memory buffer allocator (but
not using it) without defining enough other features to allow it to
compile (undefined reference to `exit()`).
Disable the memory buffer allocator when just using the ASN.1 library,
and conditionalize the heap itself to avoid using the RAM for that.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/zephyr/os.c b/boot/zephyr/os.c
index 158d52c..2f1c036 100644
--- a/boot/zephyr/os.c
+++ b/boot/zephyr/os.c
@@ -26,6 +26,7 @@
#include <mbedtls/platform.h>
#include <mbedtls/memory_buffer_alloc.h>
+#ifdef MCUBOOT_USE_MBED_TLS
/*
* This is the heap for mbed TLS. The value needed depends on the key
* size and algorithm used. For RSA-2048, 6144 bytes seems to be
@@ -42,3 +43,8 @@
{
mbedtls_memory_buffer_alloc_init(mempool, sizeof(mempool));
}
+#else
+void os_heap_init(void)
+{
+}
+#endif