mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(esp_security): cover the crypto reset coupling in the driver locks
A peripheral's reset also resets the ones it occupies, so a lock has to cover both. Gate the ECDSA MPI lock on SOC_ECDSA_USES_MPI rather than the runtime ecdsa_ll_is_mpi_required() and set that capability on C5, lock the Key Manager path in esp_key_mgr.c, clean HMAC after its reset, and enable DS before the primitives its reset covers.
This commit is contained in:
@@ -931,6 +931,10 @@ config SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ECDSA_USES_MPI
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -384,6 +384,7 @@
|
||||
/*--------------------------- ECDSA CAPS ---------------------------------------*/
|
||||
#define SOC_ECDSA_SUPPORT_EXPORT_PUBKEY (1)
|
||||
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
|
||||
#define SOC_ECDSA_USES_MPI (1) /*!< ECDSA shares MPI's reset domain: v1.0 dropped ECDSA's use of RSA but kept the clkrst coupling, so the MPI lock is still required */
|
||||
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
|
||||
#define SOC_ECDSA_SUPPORT_CURVE_P384 (1)
|
||||
#define SOC_ECDSA_SUPPORT_CURVE_SPECIFIC_KEY_PURPOSES (1) /*!< Support individual key purposes for different ECDSA curves (P192, P256, P384) */
|
||||
|
||||
@@ -429,7 +429,7 @@
|
||||
#define SOC_ECC_CONSTANT_TIME_POINT_MUL 1
|
||||
|
||||
/*------------------------- ECDSA CAPS -------------------------*/
|
||||
#define SOC_ECDSA_USES_MPI (1)
|
||||
#define SOC_ECDSA_USES_MPI (1) /*!< ECDSA reuses the MPI operand memory below rev v1.2, and shares MPI's reset domain on every revision */
|
||||
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
|
||||
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
|
||||
#define SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED (1)
|
||||
|
||||
@@ -408,6 +408,7 @@
|
||||
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
|
||||
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
|
||||
#define SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED (1)
|
||||
// #define SOC_ECDSA_USES_MPI 1 // TODO: [ESP32H21] IDF-16142
|
||||
|
||||
/*-------------------------- UART CAPS ---------------------------------------*/
|
||||
// ESP32-H21 has 2 UARTs
|
||||
|
||||
@@ -496,7 +496,7 @@
|
||||
#define SOC_ECDSA_SUPPORT_EXPORT_PUBKEY (1)
|
||||
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
|
||||
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
|
||||
#define SOC_ECDSA_USES_MPI (1)
|
||||
#define SOC_ECDSA_USES_MPI (1) /*!< ECDSA shares MPI's reset domain, so the MPI lock is required even though ECDSA uses neither the MPI engine nor its memory */
|
||||
#define SOC_ECDSA_SUPPORT_CURVE_P384 (1)
|
||||
#define SOC_ECDSA_SUPPORT_CURVE_SPECIFIC_KEY_PURPOSES (1) /*!< Support individual key purposes for different ECDSA curves (P192, P256, P384) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user