Commit Graph

700 Commits

Author SHA1 Message Date
harshal.patil
6a080ebbf8 test(mbedtls): add partial-block PSRAM coverage for AES
Extend the CTR test data length to 6433 bytes so the trailing partial
block is exercised with external RAM buffers (which stalls the ESP32-S2
Crypto DMA on an unfixed driver).
2026-09-04 09:03:13 +05:30
harshal.patil
6346bfb16b fix(mbedtls/aes): fix ESP32-S2 Crypto DMA stall on PSRAM output with partial blocks
The ESP32-S2 Crypto DMA in-channel stalls silently when a receive
descriptor list transitions from external to internal RAM. The AES
driver hits this when a PSRAM-output operation has a trailing partial
block, as the internal stream descriptor is linked after the external
RAM data descriptors.

- esp_aes_process_dma(): process the block-aligned part and the partial
  block as two separate DMA operations, keeping each descriptor list
  uniform
- crypto_dma_ll_reset(): also reset the in-channel (per the TRM receive
  reset sequence), otherwise stale state from a preceding external-RAM
  operation corrupts the next operation's output

The GCM DMA path is unaffected; it never operates on PSRAM buffers.
2026-09-03 19:32:37 +05:30
Ashish Sharma
25b55da173 feat(mbedtls): add option to choose constant-time prime generation 2026-07-21 16:00:42 +08:00
Ashish Sharma
e6fa7d627e feat(mbedtls): update to version 3.6.7 2026-07-21 15:49:22 +08:00
harshal.patil
4b3c4e2fd9 test(mbedtls): Add out-of-bounds test for the ECDSA hardware driver 2026-06-22 11:38:55 +05:30
harshal.patil
85055fabff fix(mbedtls): validate ECDSA signature range and harden ECC memory power-down
Co-Authored-By: Ashish Sharma <ashish.sharma@espressif.com>
2026-06-22 11:38:55 +05:30
Ashish Sharma
b0fc1922c5 fix(mbedtls): fixes build failure with clang21
Closes https://github.com/espressif/esp-idf/issues/18456
2026-06-15 12:03:12 +08:00
Jiang Guang Ming
a86a753e1c fix(mbedtls): fix ROM mbedTLS threading alt issues 2026-05-19 15:52:02 +08:00
Ashish Sharma
0ea58d7984 fix(protocomm): fixes potential issues that can lead to crash during device provisioning 2026-04-28 15:05:01 +08:00
Ashish Sharma
8061d573c7 change(mbedtls): adds CVE-2025-66442 to exclude list.
The CVE is applicable with Clang using LLVM's select-optimize feature. ESP-IDF uses GCC as default compiler and sets -Os as the default optimisation flag
2026-04-27 14:11:42 +08:00
Evgeny Torbin
59f62ad15f test: format all test scripts 2026-04-17 16:01:00 +02:00
Ashish Sharma
4410ef66b8 feat(mbedtls): update to version 3.6.6 2026-04-15 10:54:37 +05:30
harshal.patil
6d03d5c8fc fix(mbedlts/aes): Ensure cache coherency when DMA writes to cacheable PSRAM buffers 2026-01-14 11:22:43 +05:30
Ashish Sharma
690dd323fd feat(mbedtls): update to version 3.6.5 2025-11-11 16:49:04 +08:00
Kapil Gupta
9e6d2b439d fix(mbedtls): Addressed comments on PR15679 2025-10-06 11:48:10 +05:30
Deomid rojer Ryabkov
ce1331890d feat(mbedtls): Add mbedtls_esp_random()
Suitable for passing as f_rng to various Mbed-TLS APIs that require it
2025-10-06 11:47:58 +05:30
Mahavir Jain
86979ef6f2 Merge branch 'fix/gcm_fallback_must_depend_on_software_gcm_symbol_v5.3' into 'release/v5.3'
fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available (v5.3)

See merge request espressif/esp-idf!40808
2025-08-20 14:30:33 +05:30
Mahavir Jain
6efa12ce3e Merge branch 'change/ecdsa_does_not_use_mpi_esp32h2_eco5_v5.3' into 'release/v5.3'
The ECDSA module of ESP32-H2 ECO5 does not use the MPI module (v5.3)

See merge request espressif/esp-idf!41220
2025-08-19 20:10:15 +05:30
Aditya Patwardhan
5276f0b443 Merge branch 'feature/support_ds_peripheral_rsa_decryption_v5.3' into 'release/v5.3'
feat(mbedtls): Add support for RSA decryption with DS peripheral (v5.3)

See merge request espressif/esp-idf!40451
2025-08-14 18:31:37 +05:30
harshal.patil
2bfecc9638 change(mbedtls/ecdsa): The ECDSA module of ESP32-H2 ECO5 does not use MPI module 2025-08-13 20:50:53 +05:30
harshal.patil
4f1de8e961 fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available 2025-07-25 08:48:35 +05:30
Ashish Sharma
dfc4368a04 feat(mbedtls): adds support for RSA decryption with DS peripheral 2025-07-10 11:24:56 +08:00
Ashish Sharma
256145a1fe feat(mbedtls): update to version 3.6.4 2025-07-04 17:36:31 +08:00
Aditya Patwardhan
cddc6685f1 Merge branch 'feature/enable_support_for_deterministic_mode_and_ecdsa_192_v5.3' into 'release/v5.3'
Feature/enable support for deterministic mode and ecdsa 192 v5.3

See merge request espressif/esp-idf!40102
2025-06-25 14:37:58 +05:30
nilesh.kale
2a6e018ee8 feat: enable support for deterministic mode for esp32h2 2025-06-25 10:51:01 +05:30
hrushikesh.bhosale
636eb4b62f feat(mbedtls): Add configuration to control dynamic buffer strategy in mbedtls
Problem:
1. In low-memory scenarios, the dynamic buffer feature can fail due to memory fragmentation.
2. It requires a contiguous 16KB heap chunk, but continuous allocation and deallocation of
the RX buffer can lead to fragmentation.
3. If another component allocates memory between these operations, it can break up the
available 16KB block, causing allocation failure.

Solution:
1. Introduce configurable strategy for using dynamic buffers in TLS connections.
2. For example, convert RX buffers to static after the TLS handshake.
3. Allow users to select the strategy via a new field in the esp_http_client_cfg_t structure.
4. The strategy can be controlled independently for each TLS session.
2025-06-24 17:44:04 +05:30
nilesh.kale
19fcf0e073 feat: enabled ECDSA-P192 support for ESP32H2 2025-06-24 15:03:59 +05:30
harshal.patil
38452e4cc8 fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning
Co-authored-by: Mahavir Jain <mahavir.jain@espressif.com>
2025-05-26 13:55:08 +05:30
harshal.patil
5bd3fb9f0c fix(mbedtls): Fix config dependencies when ROM mbedtls is used 2025-04-29 11:20:25 +05:30
harshal.patil
36e5d6c695 feat(mbedtls): Make mbedtls SHA1 support configurable 2025-04-29 11:17:27 +05:30
Ashish Sharma
ededcccda5 feat(mbedtls): new config to allow weak cert verification 2025-04-15 13:10:26 +08:00
Ashish Sharma
45bf1239d6 feat(mbedtls): update to version 3.6.3 2025-04-15 13:10:26 +08:00
Ashish Sharma
9357b6c606 fix(component/mbedtls): Adds github root cert to cmn_crt_authorities.csv 2025-03-18 14:39:32 +08:00
Aditya Patwardhan
78874d7f7c feat(docs): Update minimizing binary size
The ESP32-H2 software countermeasure may not be necessary
        for ESP32-H2 v1.2 and above, this commit updates
        the relevant documentation
2025-02-26 17:04:28 +05:30
Aditya Patwardhan
08e250d081 fix(soc): Fixed ECDSA register compatibility 2025-02-26 17:04:27 +05:30
Aditya Patwardhan
68eb689b35 fix(hal): Make the ECDSA countermeasure dynamically applicable
This commit makes the ECDSA countermeasure dynamically applicable
    across different revisions of the ESP32H2 SoC.
2025-02-26 17:04:19 +05:30
Mahavir Jain
e97c51ea24 feat(ecc): enable ECC constant time mode for ESP32-H2 ECO5 2025-02-19 19:15:17 +05:30
harshal.patil
8d30077744 feat(hal/aes): Enable pseudo rounds function during AES operations 2025-01-23 14:06:16 +05:30
Harshit Malpani
b577f659cd fix: Fixed build errors with TLS 1.3 only configuration 2024-12-10 13:07:44 +08:00
harshal.patil
ea5c318031 fix(mbedtls/aes): Fix external memory corruption caused due to unaligned length cache sync
Fixes the memory corruption issue that arises due to external memory cache sync of unaligned
length bytes when L2 cache line size is greater than the L1 cache line size
2024-11-21 12:16:18 +05:30
Mahavir Jain
921a8a7e71 Merge branch 'feat/mbedtls_size_optimization_v5.3' into 'release/v5.3'
Fix the increase in build size of mbedtls while upgrading to v3.x (v5.3)

See merge request espressif/esp-idf!34252
2024-10-28 11:16:23 +08:00
nilesh.kale
75f416f435 feat(mbedtls): update mbedtls version to 3.6.2 2024-10-22 13:23:28 +05:30
Aditya Patwardhan
20ab1e807d fix(mbedtls): Fix the MBEDTLS_FS_IO dependency on vfs
By default MBEDTLS_FS_IO option in mbedtls uses the filesystem supported
added by vfs component.
If the vfs support is disabled by user then mbedtls raises a warning
that the filesystem realted operation shall always fail
This commit fixes the behaviour by enabling respective depedency check for the
MBEDTLS_FS_IO option

Closes https://github.com/espressif/esp-idf/issues/14409
2024-10-18 09:15:23 +05:30
harshal.patil
18998ddbe0 fix(mbedtls): Fix the increase in build size of mbedtls when upgrading to v3.x 2024-10-17 14:53:30 +05:30
harshal.patil
8d9d5ee218 feat(mbedtls/esp_crt_bundle): Move dummy cert to .rodata to save 408B from dram
Co-authored-by: Hanno <h.binder@web.de>
2024-10-16 16:36:33 +05:30
Mahavir Jain
6ccdda249b fix(mbedtls): link esp-cryptoauthlib to mbedcrypto library
If the certificate bundle feature is disabled then the mbedtls
component library becomes interface only component and hence
adding esp-cryptoauthlib as its PRIVATE dependency does not work.

Instead the esp-cryptoauthlib should be added as PRIVATE dependency
for mbedcrypto library (for alternate ECDSA implementation).
2024-10-15 12:15:04 +08:00
Aditya Patwardhan
8c9361afaf Merge branch 'feature/update_mbedtls_version_to_3.6.1_v5.3' into 'release/v5.3'
feat(mbedtls): updated mbedtls version to 3.6.1 (v5.3)

See merge request espressif/esp-idf!33913
2024-10-03 15:00:09 +08:00
Aditya Patwardhan
44ce512011 feat(hal): Add countermeasure for ECDSA generate signature
The ECDSA peripheral before ECO5 of esp32h2 does not perform the ECDSA
    sign operation in constant time. This allows an attacker to read the
    power signature of the ECDSA sign operation and then calculate the
    ECDSA key stored inside the eFuse. The commit adds a countermeasure
    for this attack. In this case the real ECDSA sign operation is
    masked under dummy ECDSA sign operations to hide its real power
    signature
2024-09-30 12:24:38 +08:00
nilesh.kale
82c178618d feat(mbedtls): updated mbedtls version to 3.6.1 2024-09-29 20:20:07 +05:30
Jiang Jiang Jian
144b039abc Merge branch 'feat/bringup_esp32c2_rom_mbedtls_to_formal_feature_v5.3' into 'release/v5.3'
feat(mbedtls): bringup rom mbedtls feature to formal (v5.3)

See merge request espressif/esp-idf!33800
2024-09-27 12:18:34 +08:00