Commit 4541b53a authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Increase Zephyr mempool size for encrypted images

For Zephyr the default mbedTLS mempool size for RSA-2048 signing was not
enough to allow for the calculations done by RSA-2048-OAEP (encrypted
images), so when encrypted image support is enabled, increase it to a
value that is known to work.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 2fc80df4
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/zephyr/include/mcuboot-mbedtls-cfg.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
 * the simulator build.rs accordingly.
 */

#ifdef CONFIG_BOOT_SIGNATURE_TYPE_RSA
#if defined(CONFIG_BOOT_SIGNATURE_TYPE_RSA) || defined(CONFIG_BOOT_ENCRYPT_RSA)
#include "config-rsa.h"
#elif defined(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256)
#include "config-asn1.h"
+7 −2
Changes for boot/zephyr/os.c: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -29,10 +29,15 @@

/*
 * 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
 * enough.
 * size and algorithm used.  For RSA-2048 signing, 6144 bytes seems to be
 * enough. When using RSA-2048-OAEP encryption + RSA-2048 signing, 10240
 * bytes seem to be enough.
 */
#if !defined(CONFIG_BOOT_ENCRYPT_RSA)
#define CRYPTO_HEAP_SIZE 6144
#else
#define CRYPTO_HEAP_SIZE 10240
#endif

static unsigned char mempool[CRYPTO_HEAP_SIZE];