mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
fix(bootloader_support): added ecdsa curve validation during secure boot
This commit added ECDSA key curve validation between curve selected in menuconfig and key provided.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -70,6 +70,17 @@ typedef enum {
|
||||
#define ESP_SECURE_BOOT_SCHEME ESP_SECURE_BOOT_V2_ECDSA
|
||||
#endif
|
||||
|
||||
/* Expected ECDSA curve ID from menuconfig "ECDSA key size" (matches ECDSA_CURVE_P192/P256/P384 in ROM) */
|
||||
#if CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
||||
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_192_BITS
|
||||
#define ESP_SECURE_BOOT_ECDSA_CURVE_ID ECDSA_CURVE_P192
|
||||
#elif CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_256_BITS
|
||||
#define ESP_SECURE_BOOT_ECDSA_CURVE_ID ECDSA_CURVE_P256
|
||||
#elif CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
|
||||
#define ESP_SECURE_BOOT_ECDSA_CURVE_ID ECDSA_CURVE_P384
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
|
||||
/** @brief Get the selected secure boot scheme key type
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user