From f3c6c9b6b6aab87ce56c7054d4162c9020677a53 Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Fri, 8 Nov 2024 07:45:39 +0900 Subject: [PATCH] remove hardcoded bootloader key --- bootloader/bootloader.c | 7 +------ stm32/.cproject | 5 +++-- tools/bootloader-perso.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 tools/bootloader-perso.py diff --git a/bootloader/bootloader.c b/bootloader/bootloader.c index 169f47e..faacf61 100644 --- a/bootloader/bootloader.c +++ b/bootloader/bootloader.c @@ -10,12 +10,7 @@ struct boot_vectable { #define BOOTVTAB ((struct boot_vectable *)HAL_FLASH_FW_START_ADDR) -__attribute__((section(".fw_verification_key"))) __attribute__((__used__)) const uint8_t FW_PUB[] = { - 0x95, 0xbf, 0x0a, 0xc8, 0x60, 0xea, 0xf0, 0x57, 0xdb, 0x73, 0xf0, 0x9b, 0x3e, 0xb8, 0x0c, 0x08, - 0xb7, 0xac, 0xe5, 0xd5, 0xb2, 0x78, 0x97, 0x08, 0x08, 0x11, 0x2e, 0xaf, 0x45, 0xdd, 0x06, 0xb0, - 0x62, 0x5d, 0x66, 0x7f, 0x10, 0x30, 0x41, 0x1b, 0xca, 0x91, 0x24, 0x2a, 0xb4, 0x08, 0x86, 0x89, - 0x06, 0x60, 0x47, 0xf0, 0xd3, 0x89, 0x1a, 0x68, 0xd6, 0x5a, 0x7e, 0xff, 0x0c, 0x59, 0x77, 0x20, -}; +__attribute__((section(".fw_verification_key"))) __attribute__((__used__)) const uint8_t FW_PUB[64]; bool verify_firmware() { uint8_t* const fw_area = (uint8_t*) HAL_FLASH_FW_START_ADDR; diff --git a/stm32/.cproject b/stm32/.cproject index b6717be..a02bf98 100644 --- a/stm32/.cproject +++ b/stm32/.cproject @@ -219,6 +219,7 @@ + @@ -231,7 +232,7 @@ - +