Commit Graph

283 Commits

Author SHA1 Message Date
nilesh.kale
edb3f9daf1 fix(esp_http_client): check http_parser errno after execute to avoid DoS loop 2026-07-13 12:10:15 +05:30
Mahavir Jain
442cc028b5 Merge branch 'fix/fix_esp_http_client_cross_origin_credentials' into 'master'
fix(esp_http_client): strip Authorization header on cross-origin redirect

Closes SEC-228 and SEC-049

See merge request espressif/esp-idf!48820
2026-07-06 12:20:51 +05:30
Ashish Sharma
b939d86b8e fix(esp_http_client): fix digest-auth leaks and credential/handle use-after-free 2026-07-03 17:19:05 +08:00
Aditya Patwardhan
b5023d4343 Merge branch 'feature/unified_priv_key_interface_across_idf' into 'master'
feat(esp-tls): Added a PSA driver for Secure Element

See merge request espressif/esp-idf!44987
2026-07-02 11:00:42 +05:30
Ashish Sharma
8c181842f1 feat(esp_http_client): detect oversized headers in tx buffer while sending request
When CONFIG_ESP_HTTP_CLIENT_STRICT_HEADER_BUFFER is enabled,
esp_http_client_request_send() fails fast when a single request header is
larger than buffer_size_tx, instead of silently emitting a truncated request.

The condition is reported with a dedicated ESP_ERR_HTTP_HEADER_TOO_LONG error
code rather than overloading ESP_ERR_HTTP_WRITE_DATA, so callers can tell a
permanent header-sizing failure apart from a transient write error. errno is
cleared on this path so the async caller (which maps errno == EAGAIN to "retry
later") does not spin retrying a request that can never succeed.

Closes https://github.com/espressif/esp-idf/issues/18639

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 18:24:42 +08:00
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
Mahavir Jain
da6dfc30e9 Merge branch 'feat/adds_ds_qemu_test' into 'master'
feat: adds mutual auth example

Closes IDF-2681

See merge request espressif/esp-idf!45641
2026-06-04 20:43:00 +05:30
Ashish Sharma
c6e86872d6 feat(esp_http_client_mutual_auth): add mutual TLS example
Closes https://github.com/espressif/esp-idf/issues/18393
2026-05-29 11:58:25 +08:00
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
Aditya Patwardhan
cec6f5bff4 fix(esp_http_client): require https->https for cross-scheme redirects
esp_http_client_set_redirection() now rejects any redirect target whose
scheme is not https:// when the origin is HTTPS. This catches http, ftp,
ws and any other scheme before client state is mutated. Same-host /
https-to-https redirects are unaffected. Apps that intentionally want
mixed-scheme redirects can set disable_auto_redirect=true and handle
HTTP_EVENT_REDIRECT.
2026-05-25 21:58:14 +05:30
Ashish Sharma
a4b10f1691 fix(esp_http_client): clear URL credentials and digest auth state on host change 2026-05-22 15:16:12 +08:00
Ashish Sharma
3ba6f4b786 fix(esp_http_client): strip Authorization header on cross-origin redirect 2026-05-22 15:08:14 +08:00
Jim
f521b5f76d feat(esp_http_client): Add API to support set event handler 2026-05-11 20:27:06 +08:00
Mahavir Jain
465c0b8e22 Merge branch 'fix/chunk_encoded_post_request_failed' into 'master'
fix(esp_http_client): implement chunked transfer encoding in before tranport write

Closes IDFGH-16566

See merge request espressif/esp-idf!44362
2026-04-23 14:02:41 +05:30
nilesh.kale
c3a413a8a5 fix(esp_http_client): implement chunked transfer encoding in before tranport write
Closes https://github.com/espressif/esp-idf/issues/17685
2026-04-15 16:10:16 +05:30
Ashish Sharma
9fa73b1d89 fix(esp_http_client): fix broken connection reuse
Closes https://github.com/espressif/esp-idf/issues/18430
2026-04-10 11:47:45 +08:00
Ashish Sharma
795f0466b6 fix(esp_http_client): delete Content-Length header when using Transfer-Encoding
Closes https://github.com/espressif/esp-idf/issues/18242
2026-03-16 17:31:07 +08:00
Ashish Sharma
f0f8183281 fix: removes deprecated http_crypto sources 2026-03-03 11:16:49 +08:00
hrushikesh.bhosale
8124c2e2cf refactor(protocols): Removed the common_component dependency
- Removed the common_component build dependency from protocols test_apps
and examples
2026-02-16 15:07:37 +05:30
nilesh.kale
ba308b6d76 fix(esp_https_ota): handle ota resumption if server dosent support range requests
This commit added check to see if server supports range requets,
and fallback to OTA without resumption accordingly.

Closes https://github.com/espressif/esp-idf/pull/17960
2026-02-09 13:48:48 +05:30
Ashish Sharma
1db7fac8da feat(esp_http_client): adds support to save response headers
Closes https://github.com/espressif/esp-idf/issues/17695
2026-01-28 10:20:47 +08:00
igor.udot
4c26ab876b ci: update build-test-rules to use common_components 2026-01-23 10:14:09 +08:00
Ashish Sharma
a7abc3b8e8 feat(esp_http_client): adds API to get transport socket 2026-01-21 17:04:13 +08:00
Ashish Sharma
7093db9f10 fix(esp_http_client): fix incorrect digest calculation for SHA256 auth digest
According to RFC 7616, nonce-prime and cnonce-prime is used for SHA-256-sess only and not for SHA-256.
This commit updates the check and uses nonce only for "-sess" algorithms.

Regression from 66995965e7
2026-01-06 17:16:11 +08:00
Ashish Sharma
fdd5ef561d feat: migrates esp_http_client and esp_http_server to PSA APIs 2025-12-30 09:31:49 +05:30
C.S.M
f405e51784 ci(esp32s31): Add ci build test for esp32s31 2025-12-11 15:17:15 +08:00
Ashish Sharma
69ea28c886 feat: add Kconfig option for mbedTLS 4.x 2025-12-01 14:05:05 +08:00
Mahavir Jain
66995965e7 fix(esp_http_client): prevent out-of-bounds read in Digest auth
Fixed vulnerability where malicious HTTP servers could trigger OOB reads
by sending empty or very short algorithm fields in WWW-Authenticate headers.

Changes:
- Replace unsafe memcmp() with strcasecmp() for algorithm comparison
- Add algorithm NULL validation at function entry point
- Fix duplicate md5-sess check, add missing SHA-256 check
2025-11-21 16:36:02 +05:30
Mahavir Jain
06805d177c Merge branch 'feature/mbedtls_psa_migration_migrate_esp_http' into 'master'
Migrate esp_http_client and esp_http_server to PSA API

See merge request espressif/esp-idf!41035
2025-11-03 09:39:54 +05:30
Marius Vikhammer
cd741e995f test(system): restructured system build test test-apps 2025-10-27 09:25:07 +08:00
Ashish Sharma
acf89924c8 feat(esp_http): migrate esp_http to PSA API 2025-10-26 10:13:14 +08:00
nilesh.kale
709b869a34 feat(esp_https_ota): Support partial downloading of OTA over single connection
This commit added support to download OTA with partial download feature
over single HTTP connection if server supports persistent connection.
2025-10-10 15:42:47 +05:30
nilesh.kale
845275c6f1 fix(esp_http_client): fix dispatching of finish event condition
This commit updates the condition for dispatching of FINISH event.
With this, FINISH event will be dispatched after complete data is read.

Closes https://github.com/espressif/esp-idf/issues/17437
2025-09-11 14:18:28 +08:00
nilesh.kale
2d437a6d9a fix(esp_http_client): fixed documentation for API esp_http_client_set_post_data()
Closes https://github.com/espressif/esp-idf/issues/17053
2025-08-28 14:55:55 +05:30
Aditya Patwardhan
646377c622 Merge branch 'fix/http_client_coverity_warnings' into 'master'
fix(esp_http_client): address coverity generated warnings

Closes IDF-13867, IDF-13881, and IDF-13886

See merge request espressif/esp-idf!41411
2025-08-25 17:02:07 +05:30
Mahavir Jain
47a659cd3e Merge branch 'contrib/github_pr_17429' into 'master'
docs(esp_http_client): document default timeout behaviour (GitHub PR)

See merge request espressif/esp-idf!41363
2025-08-25 10:21:53 +05:30
Mahavir Jain
70cb9d1a5c fix(esp_http_client): address coverity generated warnings 2025-08-22 19:13:24 +05:30
Mahavir Jain
1a615729d5 Merge branch 'fix/coverity_issue_483747' into 'master'
Fix possible double memory free in esp_http_client

Closes IDF-13757, IDF-13758, and IDF-13755

See merge request espressif/esp-idf!40934
2025-08-20 14:29:20 +05:30
Marek Fiala
9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
Mahavir Jain
05e149ea78 Merge branch 'feature/add_ecdsa_p384_support_and_testcases' into 'master'
feat: add ecdsa-p384 testcases and relative support for ESP32C5 ECO2

Closes IDF-13008 and IDF-12630

See merge request espressif/esp-idf!38857
2025-08-14 12:33:25 +05:30
Mahavir Jain
71d3492124 Merge branch 'fix/handle_error_and_dispatch_event_while_reading_data_from_server' into 'master'
feat(esp_http_client): handle error while reading data from server

Closes IDF-13454

See merge request espressif/esp-idf!40544
2025-08-14 11:27:36 +05:30
Richard Allen
69404c8d83 docs(esp_http_client): document default timeout behaviour 2025-08-13 10:07:38 -05:00
nilesh.kale
7edb4fae49 feat(esp_http_client): avoid dispatching of spurious event while closing closes connection
This commit updated the client closing condition to avoid spurious
dispatching of event HTTP_EVENT_DISCONNECTED while closing closeed connection.

Closes https://github.com/espressif/esp-idf/issues/16070
2025-08-12 17:31:50 +05:30
nilesh.kale
9984cc4aab feat(esp_http_client): added new HTTP state HTTP_STATE_CONNECTING and change state flow
This commit added new http state HTTP_STATE_CONNECTING, and made states public.
Also added public API to get current state.
Updated state flow in esp_http_client_perform()

Closes https://github.com/espressif/esp-idf/issues/16019
2025-08-12 17:30:38 +05:30
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
nilesh.kale
73d8ad9083 feat(esp_http_client): handle error while reading data from server
This commit updated API esp_http_cleint_perform() to handle error and
dispatched error  event if any error occured whiling reading data from server.
2025-08-11 16:39:22 +08:00
Aditya Patwardhan
b72e532598 Merge branch 'feature/move_partial_download_code_under_config' into 'master'
feat(esp_http_client): move partial download related code under config

Closes IDF-13464

See merge request espressif/esp-idf!40270
2025-08-11 11:09:49 +05:30
nilesh.kale
ce4a901460 fix(esp_http_client): fixed regression issue during enabling digest auth in client
This commit solved the issue introduced in commit a0bcffcce9
for enabling digest auth for esp_http_client.

Closes https://github.com/espressif/esp-idf/issues/17238
2025-08-06 15:38:25 +05:30