mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'feat/mbedtls_update_3.6.7_v5.2' into 'release/v5.2'
feat(mbedtls): update to version 3.6.7 (v5.2) See merge request espressif/esp-idf!50660
This commit is contained in:
@@ -255,11 +255,11 @@ menu "mbedTLS"
|
||||
and in RFC 8446, Section 7.5, for TLS 1.3.
|
||||
|
||||
config MBEDTLS_PKCS7_C
|
||||
bool "Enable PKCS #7"
|
||||
bool "Enable PKCS number 7"
|
||||
default y
|
||||
depends on MBEDTLS_X509_CRL_PARSE_C
|
||||
help
|
||||
Enable PKCS #7 core for using PKCS #7-formatted signatures.
|
||||
Enable PKCS number 7 core for using PKCS number 7-formatted signatures.
|
||||
|
||||
config MBEDTLS_SSL_CID_PADDING_GRANULARITY
|
||||
int "Record plaintext padding"
|
||||
@@ -525,6 +525,31 @@ menu "mbedTLS"
|
||||
priority level and any level from 1 to 3 can be selected (based on the availability).
|
||||
Note: Higher value indicates high interrupt priority.
|
||||
|
||||
menu "Security hardening"
|
||||
|
||||
config MBEDTLS_CONSTANT_TIME_PRIME_GEN
|
||||
bool "Constant-time prime generation"
|
||||
default n
|
||||
help
|
||||
Use mbedtls' constant-time small-factor test (a constant-time
|
||||
GCD against the product of all odd primes up to 997) when
|
||||
generating prime numbers, e.g. during RSA key generation.
|
||||
|
||||
The constant-time implementation avoids a timing side channel
|
||||
in prime generation, but it makes RSA key generation roughly
|
||||
ten times slower, and its long non-yielding software
|
||||
computations can starve the idle task and trigger the task
|
||||
watchdog, so key generation code may need a larger watchdog
|
||||
timeout or the watchdog disabled.
|
||||
|
||||
If disabled, the variable-time trial division that mbedtls
|
||||
used before version 3.6.7 is used instead, restoring key
|
||||
generation performance.
|
||||
|
||||
Please see issue: https://github.com/Mbed-TLS/mbedtls/issues/10830
|
||||
|
||||
endmenu # Security hardening
|
||||
|
||||
config MBEDTLS_HARDWARE_SHA
|
||||
bool "Enable hardware SHA acceleration"
|
||||
default y
|
||||
@@ -814,21 +839,21 @@ menu "mbedTLS"
|
||||
depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
|
||||
default y
|
||||
help
|
||||
Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
|
||||
Enable to support ciphersuites with prefix TLS-ECDHE-ECDSA-WITH-
|
||||
|
||||
config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA
|
||||
bool "Enable ECDH-ECDSA based ciphersuite modes"
|
||||
depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C && MBEDTLS_ECDSA_C
|
||||
default y
|
||||
help
|
||||
Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
|
||||
Enable to support ciphersuites with prefix TLS-ECDH-ECDSA-WITH-
|
||||
|
||||
config MBEDTLS_KEY_EXCHANGE_ECDH_RSA
|
||||
bool "Enable ECDH-RSA based ciphersuite modes"
|
||||
depends on MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE && MBEDTLS_ECDH_C
|
||||
default y
|
||||
help
|
||||
Enable to support ciphersuites with prefix TLS-ECDHE-RSA-WITH-
|
||||
Enable to support ciphersuites with prefix TLS-ECDH-RSA-WITH-
|
||||
|
||||
config MBEDTLS_KEY_EXCHANGE_ECJPAKE
|
||||
bool "Enable ECJPAKE based ciphersuite modes"
|
||||
|
||||
Submodule components/mbedtls/mbedtls updated: 9d669eadb1...2b96dd8eeb
@@ -212,6 +212,17 @@
|
||||
#undef MBEDTLS_MPI_MUL_MPI_ALT
|
||||
#endif
|
||||
|
||||
/* mbedtls 3.6.7 made the small-factor test used in prime generation
|
||||
* constant-time, which slows RSA key generation down roughly tenfold and
|
||||
* starves the idle task (the computation never yields the CPU). The
|
||||
* non constant-time variant is the default; when it is disabled,
|
||||
* fall back to the variable-time trial division from earlier releases. See
|
||||
* MBEDTLS_MPI_PRIME_SIEVE_VARIABLE_TIME in library/bignum.c.
|
||||
*/
|
||||
#ifndef CONFIG_MBEDTLS_CONSTANT_TIME_PRIME_GEN
|
||||
#define MBEDTLS_MPI_PRIME_SIEVE_VARIABLE_TIME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN
|
||||
#define MBEDTLS_ECDSA_SIGN_ALT
|
||||
#endif
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Focus on testing functionality where we use ESP32 hardware
|
||||
* accelerated crypto features
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -562,6 +562,12 @@ static void rsa_key_operations(int keysize, bool check_performance, bool generat
|
||||
}
|
||||
|
||||
|
||||
/* With constant-time prime generation the RSA-2048 key generation below takes
|
||||
* over a minute on most targets (~86 s on ESP32-S3), exceeding the test
|
||||
* timeout and starving the task watchdog, so only run it with the faster
|
||||
* variable-time implementation.
|
||||
*/
|
||||
#if !CONFIG_MBEDTLS_CONSTANT_TIME_PRIME_GEN
|
||||
TEST_CASE("mbedtls RSA Generate Key", "[mbedtls][timeout=60]")
|
||||
{
|
||||
|
||||
@@ -599,5 +605,6 @@ TEST_CASE("mbedtls RSA Generate Key", "[mbedtls][timeout=60]")
|
||||
#endif // CONFIG_MBEDTLS_MPI_USE_INTERRUPT && CONFIG_ESP_TASK_WDT_EN && !CONFIG_ESP_TASK_WDT_INIT
|
||||
|
||||
}
|
||||
#endif // !CONFIG_MBEDTLS_CONSTANT_TIME_PRIME_GEN
|
||||
|
||||
#endif // CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
|
||||
@@ -118,5 +118,5 @@ Reducing Binary Size
|
||||
Under ``Component Config -> mbedTLS``, there are multiple Mbed TLS features which are enabled by default but can be disabled if not needed to save code size. More information can be about this can be found in :ref:`Minimizing Binary Size <minimizing_binary_mbedtls>` docs.
|
||||
|
||||
|
||||
.. _`API Reference`: https://mbed-tls.readthedocs.io/projects/api/en/v3.6.6/
|
||||
.. _`API Reference`: https://mbed-tls.readthedocs.io/projects/api/en/v3.6.7/
|
||||
.. _`Knowledge Base`: https://mbed-tls.readthedocs.io/en/latest/kb/
|
||||
|
||||
@@ -118,5 +118,5 @@ ESP-IDF 中的示例使用 :doc:`/api-reference/protocols/esp_tls`,为访问
|
||||
在 ``Component Config -> mbedTLS`` 中,有多个 Mbed TLS 功能默认为启用状态。如果不需要这些功能,可将其禁用以减小固件大小。要了解更多信息,请参考 :ref:`Minimizing Binary Size <minimizing_binary_mbedtls>` 文档。
|
||||
|
||||
|
||||
.. _`API Reference`: https://mbed-tls.readthedocs.io/projects/api/en/v3.6.6/
|
||||
.. _`API Reference`: https://mbed-tls.readthedocs.io/projects/api/en/v3.6.7/
|
||||
.. _`Knowledge Base`: https://mbed-tls.readthedocs.io/en/latest/kb/
|
||||
|
||||
Reference in New Issue
Block a user