Commit Graph

37319 Commits

Author SHA1 Message Date
Rahul Tank
2453200f60 fix(nimble): Defer Events / ATT related information from stack
Defer Events/ ATT related GAP events from stack until connection
 event is sent to GAP layer
2026-07-03 11:13:09 +05:30
Mahavir Jain
6df37e9bec Merge branch 'fix/fix_psk_hint_key_null_dereference' into 'master'
Fix/fix psk hint key null dereference

Closes IDF-15854 and TZ-2615

See merge request espressif/esp-idf!50179
2026-07-03 09:39:31 +05:30
Mahavir Jain
625ee1abb7 Merge branch 'fix/harden_esp_security' into 'master'
fix(esp_security): harden crypto peripheral error handling

Closes SEC-236, SEC-351, SEC-352, SEC-353, SEC-355, SEC-356, and SEC-357

See merge request espressif/esp-idf!49828
2026-07-03 09:11:33 +05:30
Ashish Sharma
6d1beb1f23 fix(esp-tls): guard against NULL PSK hint to prevent crash 2026-07-03 11:34:59 +08:00
Wan Lei
86449a8909 Merge branch 'feat/twai_time_trigger_trans' into 'master'
feat(driver_twai): fd hardware support time trigger trans

Closes IDF-12040

See merge request espressif/esp-idf!49524
2026-07-03 11:33:58 +08:00
Mahavir Jain
55c6099838 Merge branch 'refactor/normalize_tee_pycli_script_output' into 'master'
refactor(esp_tee): Normalize the `esp_tee` python tools CLI output

Closes IDF-15329

See merge request espressif/esp-idf!49274
2026-07-03 08:55:22 +05:30
Island
1528f58c00 Merge branch 'fix/ble-log-64-bit-io-setup-support' into 'master'
fix(ble_log): use BIT64 over BIT to support 64-bit IO setup

See merge request espressif/esp-idf!50283
2026-07-03 00:54:00 +08:00
Mahavir Jain
4799efa609 Merge branch 'fix/httpd-content-length-truncation' into 'master'
fix(esp_http_server): reject Content-Length above UINT32_MAX

Closes SEC-102 and SEC-229

See merge request espressif/esp-idf!47554
2026-07-02 21:07:27 +05:30
Laukik Hase
93e2c1e637 refactor(esp_tee): Normalize the esp_tee python tools CLI output 2026-07-02 18:25:54 +05:30
Laukik Hase
e9da155a72 Merge branch 'ci/fix_esp_tee_cli_app_build' into 'master'
ci(esp_tee): Fix `tee_cli_app` build failure due to heap size overflow

See merge request espressif/esp-idf!50297
2026-07-02 16:17:32 +05:30
Jiang Jiang Jian
fa86d80f71 Merge branch 'feat/nan_gtk_support' into 'master'
feat(wifi_aware): advertise group data/mgmt protection (GTK/IGTK/BIGTK) and iOS compliance fixes

See merge request espressif/esp-idf!49800
2026-07-02 18:32:56 +08:00
Adam Múdry
ab352fdbaf Merge branch 'fix/sdmmc_double_buffering_psram_dma_capable' into 'master'
fix(sdmmc): Add a better handling of devices accessing PSRAM through DMA

Closes IDFGH-17455

See merge request espressif/esp-idf!47685
2026-07-02 12:16:19 +02:00
Tomas Rezucha
5f84dab44c Merge branch 'change/utmi_phy_eco_src' into 'master'
change(soc/usb): Merge duplicated definitions for P4 v1 and v3

Closes IDF-13430

See merge request espressif/esp-idf!50272
2026-07-02 11:50:06 +02:00
Laukik Hase
e7261f57f5 ci(esp_tee): Fix tee_cli_app build failure due to heap size overflow
- Also fix the `unused variable` warning while builing the PSA
  AES tests with `tee_test_fw` app
2026-07-02 15:14:42 +05:30
Adam Múdry
0de4ceee63 feat(sdmmc): Use zero-copy TX for SDSPI 2026-07-02 11:39:20 +02:00
Adam Múdry
ba4503a9b5 fix(sdmmc): Add a better handling of devices accessing PSRAM through DMA
Closes https://github.com/espressif/esp-idf/issues/18412
2026-07-02 11:39:20 +02:00
C.S.M
08b5996134 Merge branch 'fix/flash_32bit_addr' into 'master'
fix(spi_flash): fix flash 32bit address operation on esp32s31

See merge request espressif/esp-idf!50248
2026-07-02 16:50:22 +08:00
Igor Udot
81a613f5b8 Merge branch 'bugfix/parttool-extra-partition-subtypes-eat-all' into 'master'
fix(partition_table): restore multi-value --extra-partition-subtypes parsing

See merge request espressif/esp-idf!50287
2026-07-02 16:20:57 +08:00
Mahavir Jain
bd250902b8 Merge branch 'fix/fix_esp_tee_failing_deterministic_ecdsa_sign' into 'master'
fix(esp_tee): release SHA held by HMAC after crypto peripheral reset

See merge request espressif/esp-idf!50286
2026-07-02 13:46:59 +05:30
Guillaume Souchere
06c7851457 Merge branch 'fix/freertos-linux-simulator' into 'master'
fix(freertos): discard stale wake events on linux port context switch

Closes IDF-15882

See merge request espressif/esp-idf!50285
2026-07-02 10:11:04 +02:00
Mahavir Jain
98f7c78787 Merge branch 'fix/gcc16_unused_but_set_variable' into 'master'
Fix unused-but-set-variable warnings with GCC 16

See merge request espressif/esp-idf!50282
2026-07-02 13:40:46 +05:30
sonika.rathi
0c6367d15f fix(partition_table): restore multi-value --extra-partition-subtypes parsing 2026-07-02 09:11:29 +02:00
Ashish Sharma
2cbd0afed8 fix(esp_tee): fixes double panic when ESP-TEE panics 2026-07-02 14:52:53 +08:00
Ashish Sharma
2458c81d7d fix(esp_tee): release SHA held by HMAC after crypto peripheral reset 2026-07-02 14:52:53 +08:00
Shen Wei Long
49d191730e Merge branch 'feature/added_qa_related_vs_cmd' into 'master'
feat(ble): Updated libble to 6bbfb64 on ESP32-S31 and ESP32-H4

See merge request espressif/esp-idf!50267
2026-07-02 06:42:40 +00:00
Guillaume Souchere
513c013403 fix(freertos): discard stale wake events on linux port context switch
On the Linux port, tasks are pthreads that cannot be forcibly paused;
the scheduler "unschedules" a task only by selecting a different next
task, and the outgoing task keeps running until it next blocks itself
in event_wait (e.g. via vPortYield). If the scheduler later switches
back into such a task (event_signal) before it ever parked in
event_wait, that wake is never consumed and event_triggered stays
latched. The task's next voluntary block then returns immediately
instead of blocking (e.g. vTaskDelay(100ms) returning in 0ms), which
desynchronizes kernel and port scheduling state.

Clear the outgoing task's pending event when switching to a different
task, under s_port_mutex and atomically with the scheduling decision.
Any latched-but-unconsumed wake is stale at that point; a legitimate
wake can only be delivered later, once the scheduler selects the task
again as next_thread.

Add event_clear() to the wait_for_event helper to support this.

Verified: minimal repros (busy-wait with another ready task, and
pthread-blocked task) now measure 92-101 ms for vTaskDelay(100ms)
instead of 0 ms; linux_freertos kernel test app 18/18 pass; the
previously failing esp_linenoise host test suite passes 34/34.
2026-07-02 08:30:14 +02:00
David Čermák
59d66afdd2 Merge branch 'fix/lwip_sec_high' into 'master'
fix(lwip): high severity lwip fixes

See merge request espressif/esp-idf!49930
2026-07-02 14:15:34 +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
Aditya Patwardhan
9d3f510c7f fix(esp_http_server): reject Content-Length above UINT32_MAX
In httpd_parse.c, cb_headers_complete() converted the HTTP parser's
content_length (uint64_t) to the request's content_len (size_t) via an
unsafe cast through (int). On a 32-bit size_t target a Content-Length
above 4 GiB silently truncated, enabling request smuggling where the
server and an upstream proxy disagree on the body length (CWE-681).

Reject any Content-Length above UINT32_MAX with 413 Content Too Large
before any handler runs. UINT32_MAX is the largest body length the
server can represent in size_t content_len on every target, so this is
the maximum the server can support; no configuration knob is needed.

Closes SEC-102
Closes SEC-229
2026-07-02 10:46:36 +05:30
Zhou Xiao
a2876d304e fix(ble_log): use BIT64 over BIT to support 64-bit IO setup 2026-07-02 11:26:11 +08:00
morris
829576fdab fix(dac): remove redundant assert in continuous enable
Drop the internal assert in dac_continuous_enable() and call
 dac_priv_enable_channel() directly, since the surrounding state
 machine already guarantees the preconditions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 10:36:34 +08:00
Mahavir Jain
e16593ebc0 fix(esp_psram): fix unused-but-set-variable warning with GCC 16
GCC 16 flags the volatile accumulator in the cache writeback loops even
though it is volatile, as it is only used to update itself. Drop the
accumulator and rely on the volatile-qualified psram pointer to keep
the cache-line reads from being optimized out.
2026-07-02 07:55:14 +05:30
Mahavir Jain
bd567cf046 fix(wpa_supplicant): fix unused-but-set-variable warnings with GCC 16
GCC 16 raised the default level of -Wunused-but-set-variable and now
flags variables that are only used to update themselves. Remove the
'removed' counter in pmksa_cache_flush() (its only read was commented
out) and mark the EAP-FAST PAC entry counters as unused, since their
only read is inside wpa_printf(MSG_DEBUG, ...) which compiles to a
no-op when debug logging is disabled.
2026-07-02 07:55:13 +05:30
David Cermak
4c3d56aeb6 fix(lwip): tcp/ooseq: do not accept empty fin seg (+ other fixes)
* Update submodule: git log --oneline 9d2d8041..c6f2f878
  - test(lwip): add DHCP MTU validation unit test (espressif/esp-lwip@c6f2f878)
  - ppp: fix potential oob read in VJ decompression (espressif/esp-lwip@2ff439e6)
  - ip6-frag: Fix incorrect memcpy size to the actual struct (espressif/esp-lwip@91ad363b)
  - tcp/ooseq: do not accept empty fin seg (espressif/esp-lwip@fe4fb18c)
2026-07-01 20:21:59 +02:00
Tomas Rezucha
702dc82ed4 change(soc/usb): Merge duplicated definitions for P4 v1 and v3 2026-07-01 19:49:07 +02:00
Sarvesh Bodakhe
61b705f030 refactor(wifi): astyle-format wifi_netif.c
The ternary continuation in esp_wifi_netif_set_static_neighbor() was not
astyle-formatted; re-indent it so the pre-commit astyle hook passes in CI.
2026-07-01 20:30:47 +05:30
Sarvesh Bodakhe
4639b57485 refactor(nan): drop '##' debug marker from key hexdump tags
The six key-material hexdumps (ND-IGTK/BIGTK/TK/GTK and the peer IGTK/BIGTK)
kept a leftover '##' dev-grep marker on their tag string. Drop it; the
descriptive labels stay and the dumps remain at ESP_LOG_DEBUG.
2026-07-01 20:26:10 +05:30
Sarvesh Bodakhe
21a5c603e8 change(wifi): sync NAN/netif wifi headers + rebuilt libs [d3da506]
- injected esp_wifi_netif.h: add esp_wifi_netif_get_ip6_linklocal_from_mac()
  and esp_wifi_netif_set_static_neighbor() (static ND6 IPv6-pin API).
- esp_wifi_types_generic.h (public + injected): rename the NCS-GTK cipher
  suites CCM_128 -> CCMP_128 / GCM_256 -> GCMP_256 to match Wi-Fi Aware v4.0
  (Table 121, section 9.5.21.1); refresh NAN group-protection docs. Enum
  values (5/6), struct layout and on-air behaviour are unchanged.
- nan_security.c: use the renamed macros and update the advertise log.
- esp_wifi/lib: bump to the rebuilt blobs carrying the renamed MD5-checked
  header (han2 d3da506).
2026-07-01 20:18:37 +05:30
Sarvesh Bodakhe
2cc14d131f fix(nan): restrict GTK Key ID to 1/2 and ignore cleartext group KDEs
- Tighten the own GTK Key ID guard from ">3" (which admitted 0 and 3) to
  the spec range 1..2 (Wi-Fi Aware v4.0 §7.1.3.2).
- When the Encrypted-Key-Data bit is clear, ignore the Key Data instead of
  parsing KDEs from the clear: group KDEs are only ever carried KEK-wrapped
  (§7.1.3.5; 802.11-2020 §12.7.2). Also store the peer IPN/BIPN from the
  IGTK/BIGTK KDEs for the BIP RX replay-counter seed.
2026-07-01 18:12:25 +05:30
Sarvesh Bodakhe
235207bb2a fix(nan): seed peer BIP RX replay counter from the KDE IPN/BIPN
The peer IGTK/BIGTK were installed with an all-zero seq, so the blob's BIP
RX replay counter started at 0 instead of the peer's advertised value. Store
the 6-octet IPN/BIPN from the IGTK/BIGTK KDE (the octets after the 2-byte
Key ID, per 802.11 Fig 12-42/12-47) into the NDL and pass them as the
install seq. The parser side of this lands with the group-KDE guards.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
1c59572c07 change(wifi): update libs [2e77d2e]
Rebuilt libs with NAN group-key (GTK/IGTK/BIGTK) support, matching the
nan_key_type_t and group-protection header updates so the MD5-checked
esp_wifi_driver.h and esp_wifi_types_generic.h verify.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
e952a580db docs(nan): document group-protection fields, CSID ciphers and NIRA
Refresh stale/missing documentation now that the features are implemented:
- group_data_prot / group_mgmt_prot in wifi_nan_discovery_security_params_t
  (esp_wifi_types_generic.h) and wifi_nan_security_params_t (esp_private/
  wifi.h): describe GTKSA / IGTKSA+BIGTKSA instead of "not supported".
- CSID enum: document NCS-GTK-CCM-128 (set internally via group_data_prot,
  not user-selectable) and NCS-PK-PASN-128 (NAN Pairing, via the Wi-Fi
  Aware component).
- Drop "dummy" from the esp_nan_construct_nira() doc (it builds a real
  NIRA) and a stale "IGTK/BIGTK are placeholders" comment.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
ebb9539d17 refactor(nan): use shared nan_key_type_t from esp_wifi_driver.h
The NAN key-type selectors are defined by the blob in esp_wifi_driver.h
(nan_key_type_t), which nan_i.h already includes. Add the group-integrity
key types NAN_KEY_ND_IGTK (3) and NAN_KEY_ND_BIGTK (4) there to match the
blob, and drop the duplicate host definitions from nan_i.h so a single
shared enum is used. Resolves the review request to declare these in
nan_key_type_t and avoids redefining the typedef.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
8b2b386825 refactor(nan): declare NAN key types as nan_key_type_t enum
Move the NAN_KEY_ND_TK/ND_GTK/NM_TK/ND_IGTK/ND_BIGTK selectors from #defines
into a nan_key_type_t enum, and finalize their doc wording (drop the
"provisional" note now that the IGTK/BIGTK values are verified against the
blob ABI). They are still passed to esp_wifi_set_nan_key_internal() as the
int key_flag argument, so no call-site or ABI change. Also tidy the
surrounding doc comments.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
5275d5ef08 refactor(nan): put RSN KDE OUI in one array, drop dead OUI byte macros
Replace the three NAN_KDE_OUI_RSN_* byte writes in nan_kde_put_hdr() with a
single nan_kde_rsn_oui[] array, and remove the now-unused NAN_KDE_OUI_RSN_*
byte macros and the never-used NAN_KDE_OUI_WFA_* byte macros. The combined
NAN_KDE_OUI_RSN / NAN_KDE_OUI_WFA (used by the KDE parser) are kept.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
dc3ada69b5 refactor(nan): drop commented-out debug logging
Remove the dead commented-out ESP_LOGI debug prints flagged in review: the
"Sent Publish to Peer" line in nan_app.c, and the SCIA-construct,
CSIA-construct and CSIA-len-getter blocks in nan_security.c.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
553d969c4f fix(nan): pass no event payload to NAN netif bring-up action
The NAN-started handler brought the netif up via esp_netif_action_connected()
using the NAN-started event's base/event_id/data. Feeding a "connected"
action from a "started" event and handing it an unrelated event payload is
fragile: it would misbehave if the action handler ever interpreted data
(which is not a wifi_event_sta_connected_t here).

esp_netif_up() is private to the esp_netif component, so keep the public
esp_netif_action_connected() but pass NULL base, 0 event_id, NULL data. This
is safe because the NAN netif is not a DHCP client: the handler only calls
esp_netif_up() and never reads the event args.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
0baa39835e fix(nan): restore SCIA length getter debug log
The MR had turned the active ESP_LOGD("GET SCIA LEN") into a commented-out
ESP_LOGI. Restore the original ESP_LOGD so the log stays live at DEBUG and
no dead commented code is left behind.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
d0e2943621 fix(nan): source group_mgmt_prot from start config, not blob read-back
esp_nan_action_start() read group_mgmt_prot back from the blob via
esp_wifi_get_config() and defaulted to true when the read failed, which
force-enabled device-global IGTK/BIGTK (BIP beacons, forced GTKSA) on a
path where the user's intent is unknown. group_mgmt_prot is a pure
pass-through user flag, so capture it directly into s_nan_ctx from the
config in esp_wifi_nan_sync_start() (next to use_nvs_for_caching) and drop
the read-back and its ambiguous default. Behaviour now follows the user's
config exactly (default false via WIFI_NAN_SYNC_CONFIG_DEFAULT).
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
a870826c5a fix(nan): set group_mgmt_prot in WIFI_NAN_SYNC_CONFIG_DEFAULT
The default initializer explicitly sets every other bool field but omitted
the new group_mgmt_prot, leaving the intended default ambiguous. Set it to
false so the macro stays exhaustive; both example apps use it.
2026-07-01 18:12:24 +05:30