Skip to content

Commit e36d3c8

Browse files
kasjerde-nordic
authored andcommitted
boot: boot_serial: Fix mynewt build without encryption
boot_serial_encryption.c can exclude all code when MCUBOOT_ENC_IMAGES is not defined. However it first includes several headers that fail to build in mynewt where MCUBOOT_ENC_IMAGES is always undefined (so far). This change includes configuration first and if MCUBOOT_ENC_IMAGES is not defined it also skips unnecessary includesion of headers and not only actual code for encrypted images over serial. Error that was detected: repos/mcuboot/boot/bootutil/include/bootutil/crypto/aes_ctr.h: In function 'bootutil_aes_ctr_encrypt': repos/mcuboot/boot/bootutil/include/bootutil/crypto/aes_ctr.h:100:12: error: implicit declaration of function 'mbedtls_aes_crypt_ctr'; did you mean 'mbedtls_aes_crypt_ecb'? [-Wimplicit-function-declaration] 100 | return mbedtls_aes_crypt_ctr(ctx, mlen, &blk_off, counter, stream_block, m, c); | ^~~~~~~~~~~~~~~~~~~~~ | mbedtls_aes_crypt_ecb Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
1 parent da6efd1 commit e36d3c8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

boot/boot_serial/src/boot_serial_encryption.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
* Copyright (c) 2020 Arm Limited
66
*/
77

8+
#include "mcuboot_config/mcuboot_config.h"
9+
10+
#ifdef MCUBOOT_ENC_IMAGES
11+
812
#include <assert.h>
913
#include "bootutil/image.h"
1014
#include <../src/bootutil_priv.h>
1115
#include "bootutil/bootutil_log.h"
1216
#include "bootutil/bootutil_public.h"
1317
#include "bootutil/fault_injection_hardening.h"
1418

15-
#include "mcuboot_config/mcuboot_config.h"
16-
17-
#ifdef MCUBOOT_ENC_IMAGES
18-
1919
BOOT_LOG_MODULE_DECLARE(serial_encryption);
2020

2121
fih_ret

0 commit comments

Comments
 (0)