Skip to content

Commit 993fe35

Browse files
tpamboradeaarm
authored andcommitted
BL2: Define bootutil_key_cnt for ECDSA keys
Compiling with the options: - MCUBOOT_SIGNATURE_TYPE=EC-P256 - MCUBOOT_BUILTIN_KEY=OFF - MCUBOOT_HW_KEY=OFF causes the following linker errors: /opt/zephyr-sdk-1.0.1/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/../../../../arm-zephyr-eabi/bin/ld: bl2/ext/mcuboot/bootutil/libbootutil.a(image_validate.o): in function `bootutil_img_validate': /home/user/west_workspace/bootloader/mcuboot/boot/bootutil/src/image_validate.c:601:(.text.bootutil_img_validate+0x1e8): undefined reference to `bootutil_key_cnt' /opt/zephyr-sdk-1.0.1/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/../../../../arm-zephyr-eabi/bin/ld: bl2/ext/mcuboot/bootutil/libbootutil.a(bootutil_find_key.o): in function `bootutil_find_key': /home/user/west_workspace/bootloader/mcuboot/boot/bootutil/src/bootutil_find_key.c:69:(.text.bootutil_find_key+0x7c): undefined reference to `bootutil_key_cnt' Fix this by defining bootutil_key_cnt in keys.c for ECDSA keys. Change-Id: Icea5b17986fa86e262c8c14e3786524c125c70c3 Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
1 parent f604dfa commit 993fe35

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

bl2/ext/mcuboot/keys.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,6 @@ const struct bootutil_key bootutil_keys[] = {
397397
},
398398
#endif /* MCUBOOT_IMAGE_NUMBER > 3 */
399399
};
400+
const int bootutil_key_cnt = MCUBOOT_IMAGE_NUMBER;
400401
#endif /* MCUBOOT_SIGN_RSA */
401402
#endif /* HAVE_KEYS */

0 commit comments

Comments
 (0)