Commit Graph
227 Commits
Author SHA1 Message Date
Aditya Patwardhan 8fe74703bc fix(esp-tls): Keep deprecated use_secure_element field for compatibility
Restore the use_secure_element field in esp_tls_cfg_t, esp_tls_cfg_server_t
and httpd_ssl_config_t, and esp_transport_ssl_use_secure_element(), as
deprecated no-ops so that existing code keeps compiling. Setting them now
fails at runtime with ESP_ERR_NOT_SUPPORTED, as the feature is accessed
via the esp_key_config_t interface. To be removed in the next major release.
2026-07-15 12:40:55 +05:30
Aditya Patwardhan 36090b7161 feat(esp-tls): Add unified private key interface via esp_key_config_t
Add ESP_KEY_SOURCE_BUFFER and ESP_KEY_SOURCE_PSA key sources so all
hardware backends (DS, ECDSA, secure element) are accessed via PSA
key IDs through a single esp_tls_cfg_t.client_key field.
2026-06-25 11:31:37 +05:30
Guillaume Souchere d670774f5c feat(esp_common): implement composable error code registration via link-time arrays
Refactor the esp_err_to_name() system to decouple esp_common from
higher-level components. Instead of a monolithic generated table,
each component registers its error codes into a dedicated linker
section (.esp_err_msg_table) via idf_define_esp_err_codes() in its
CMakeLists.txt.

New files:
- tools/err_codes_extract.py: extract ESP_ERR_* defines from headers to CSV
- tools/err_codes_to_c.py: generate C source placing entries into linker section
- tools/err_codes_to_rst.py: generate RST documentation from error codes
- tools/cmake/err_codes.cmake: CMake module providing idf_define_esp_err_codes()
- components/esp_common/include/esp_err_codes.h: esp_err_msg_t typedef
- components/esp_common/src/esp_err_to_name_new.c: new lookup using link-time array
- tools/test_apps/build_system/err_codes_check/: CI test app

Changes:
- Remove all optional component dependencies from esp_common/CMakeLists.txt
- Add .esp_err_msg_table section to all 5 linker scripts
- Register error codes in 18 components via idf_define_esp_err_codes()
- Add new scripts to .gitlab/ci/rules.yml build_check patterns
- use new scripts to generate doc and add CI validation
- Update esp_err.rst to add description of composable code registration
2026-05-28 09:53:32 +02:00
surengab d22d5e83b4 fix(ws_transport): reject oversized 64-bit WebSocket payload length 2026-05-21 14:54:12 +04:00
surengab 5c43ec149d fix(transport_ws): read full PING payload in one call when propagate_control_frames is set 2026-04-22 12:44:15 +04:00
surengab e19d2a9a69 fix(transport_ws): flush oversized control frame payload before returning error 2026-04-22 12:44:14 +04:00
Suren Gabrielyan 99a3482578 Merge branch 'refactor/tcp_transport' into 'master'
refactor(tcp_transport): move connection-closed socket polling from ws transport to base transport layer

Closes IDF-15237

See merge request espressif/esp-idf!47003
2026-04-14 10:38:46 +00:00
surengab b39dfc970e refactor(tcp_transport): move connection-closed socket polling from WS to base transport layer 2026-03-25 15:34:10 +04:00
nilesh.kale 8a37408fa7 fix(tcp_transport): reset state on async TLS connect failure to avoid use-after-free 2026-03-18 11:56:29 +05:30
Suren Gabrielyan e3b2615358 Merge branch 'bugfix/ws-transport-buffer-timeout' into 'master'
fix(ws_transport): Optimize polling and fix buffer overflow/handshake issues

Closes IDFGH-16945

See merge request espressif/esp-idf!44190
2026-03-04 07:49:51 +00:00
surengab 5eff7a1705 fix(transport_ws): add RFC 6455 validation for control frame payload size 2026-02-18 15:28:36 +04:00
surengab 7f2006b388 fix(transport_ws): add RFC 6455 validation for fragmented control frames 2026-02-18 15:26:55 +04:00
surengab 1ac711055b fix(transport_ws): reject reserved opcodes per RFC 6455 2026-02-18 15:24:44 +04:00
surengab 85da1a0533 fix(transport_ws): validate RSV bits per RFC 6455(reject frames with non-zero RSV) 2026-02-18 15:16:29 +04:00
surengab cfec8480a3 fix(transport_ws): fix handshake failure with small response buffer 2026-02-18 15:13:00 +04:00
surengab dda0c8572a test(transport_ws): add tests for polling logic and handshake edge cases 2026-02-18 15:13:00 +04:00
surengab 9feedcbf4e fix(transport_ws): optimize ws polling and fix read error logging 2026-02-18 15:13:00 +04:00
Suren Gabrielyan baed36a33d fix(transport_ws): fix ws buffer overflow check and missing delimiter handling 2026-02-18 15:12:59 +04:00
Sudeep Mohanty 6dabadae86 fix(tcp_transport): Fixed linux build for Build System v2
For Build System v2 on linux target, esp_timer dependency must be
conditional on CONFIG_LWIP_IPV4 rather than checking BUILD_COMPONENTS.
v2 uses configuration-driven dependencies.
2026-02-18 09:58:05 +01:00
morris 291554cd09 refactor(global): remove completed todos in the codebase 2025-12-15 22:40:15 +08:00
C.S.M f405e51784 ci(esp32s31): Add ci build test for esp32s31 2025-12-11 15:17:15 +08:00
Alexey Lapshin 31810ae993 feat(esp_libc): make picolibc default libc 2025-12-03 13:31:42 +07:00
Ashish Sharma 8f0a19d169 fix: fix the failing tcp_transport host test in the CI 2025-10-16 11:47:08 +08:00
Richard Allen ec09815ed5 fix(transport_ws): Reject multiple Sec-WebSocket-Accept headers
Enforce RFC6455 requirement:
    The |Sec-WebSocket-Accept| header MUST NOT
    appear more than once in an HTTP response.
2025-09-12 10:03:42 -03:00
glmfe 11f8534266 feat(ws_transport): Merged set_header_hook and set_header_userp functions 2025-09-12 13:39:41 +08:00
Richard Allen 58befcae26 feat(transport_ws): add header callback hook
Move to a line-by-line header parser.
Support a callback hook for each header-line.
Migrate "Location" and "Sec-WebSocket-Accept" parsing.

Part of https://github.com/espressif/esp-protocols/issues/715
2025-09-12 13:39:41 +08:00
Richard Allen cd4982a14f feat(transport_ws): buffer redir_host separately
Buffer separately to simplify future improvements.
2025-09-12 13:39:41 +08:00
Roland Dobai 47d11179f1 fix(components/tcp_transport): Fix missing file extension in the test_app 2025-08-19 14:44:32 +02:00
Marek Fiala 9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
nilesh.kale dedc9889de feat: added config member to store block number for hign part of ecdsa key 2025-08-11 16:01:10 +05:30
nilesh.kale 08e781c876 feat: added new config member to provide ecdsa curve type 2025-08-11 16:01:09 +05:30
nilesh.kale 68f06a94bd feat: add ecdsa-p384 testcases and relative support for ESP32C5 ECO2
This commit adds testcases in crypto/hal and mbedtls testapps.
2025-08-11 16:01:01 +05:30
Marius Vikhammer bf84ab652a change(test_utils): moved test_utils component to tools/test_apps/components/ 2025-07-21 14:05:50 +08:00
Guilherme Ferreira 8884211036 Merge branch 'fix/idfg-15478' into 'master'
fix(tcp_transport): off-by-one buffer corruption when WS header buffer full

Closes IDFGH-15478

See merge request espressif/esp-idf!39878
2025-07-16 18:18:06 +08:00
Fu Hanxi a5257dcc39 ci: apply idf-ci pytest plugin
Removed

- target markers. Now must use target as parametrization in esp-idf
- host test markers. Now will be automatically added with linux target and qemu marker
2025-07-09 10:33:28 +02:00
glmfe 23572e043e fix(tcp_transport): off-by-one buffer corruption when WS header buffer full
- Fix out of boundaries access
 - Improve test cases to cover this issue
2025-06-26 08:05:46 -03:00
Rocha Euripedes 1548e1dd67 Merge branch 'contrib/github_pr_16118' into 'master'
docs(esp_transport_ws): fix parameter name documentat (GitHub PR)

See merge request espressif/esp-idf!39827
2025-06-13 14:01:42 +08:00
Richard Allen a8b6017ca5 docs(esp_transport_ws): fix parameter name documentation 2025-06-12 10:44:06 -05:00
hrushikesh.bhosale 5928a87aa7 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-05 12:43:47 +05:30
glmfe 1d71a9e811 feat(tcp_transport): Add ws get HTTP response headers 2025-05-21 16:34:10 +02:00
Rocha Euripedes 061c05c88c Merge branch 'contrib/github_pr_15967' into 'master'
fix(tcp_transport): Silence recoverable read failures (GitHub PR)

Closes IDFGH-15309

See merge request espressif/esp-idf!39259
2025-05-20 17:02:17 +08:00
Richard Allen 7f982fa09d fix(tcp_transport): Silence recoverable read failures
In some applications, ESP_TLS_ERR_SSL_WANT_READ and
ESP_TLS_ERR_SSL_TIMEOUT are common results which
need handled at the next layer. Downgrade these
to debug.
2025-05-16 08:37:19 -05:00
Guilherme Ferreira a5313b998c Merge branch 'feat/add-ws-redir' into 'master'
feat(tcp_transport): Add websocket HTTP redirect

Closes IDF-9073

See merge request espressif/esp-idf!37175
2025-05-15 18:56:56 +08:00
glmfe 2205a22dc1 feat(tcp_transport): Add websocket HTTP redirect
- Add and expose URI parser from HTTP when received a 301 status
2025-05-06 08:20:42 -03:00
dhb 141700ade5 feat(tcp_transport): add API to configure SSL cipher suites
Add new API esp_transport_ssl_set_ciphersuites_list() to allow configuring custom
TLS cipher suites in SSL transport layer. This enables users to:
- Set specific cipher suites for SSL/TLS connections
2025-04-28 16:10:56 +08:00
Guilherme Ferreira 87ce14650b Merge branch 'feat/ws-err-codes' into 'master'
feat(ws_transport): include error reason in failure log

Closes IDFGH-13978

See merge request espressif/esp-idf!38216
2025-04-11 19:35:17 +08:00
Richard Allen 5362a03eac feat(ws_transport): include error reason in failure log
When the underlying transport returns a failure,
add the failure result to the log.
2025-04-10 07:22:37 -03:00
Guilherme Ferreira 177c542be3 Merge branch 'fix/fix-test-socks-transport' into 'master'
fix(tcp_transport): Fix test for socks transport

Closes IDFCI-2781

See merge request espressif/esp-idf!38045
2025-04-07 22:34:34 +08:00
Chen Ji Chang c3a3cc8657 Merge branch 'feat/h4_enable_ci_build' into 'master'
feat(esp32h4): enable ESP32H4 ci build

Closes IDF-12332

See merge request espressif/esp-idf!37921
2025-03-31 23:49:48 +08:00
Rocha Euripedes 96ff542397 Merge branch 'contrib/github_pr_15300' into 'master'
fix(transport_ws): remove unnecessary noise from error message (GitHub PR)

Closes IDFGH-14538

See merge request espressif/esp-idf!37079
2025-03-28 19:02:03 +08:00