Commit Graph

53602 Commits

Author SHA1 Message Date
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
Sarvesh Bodakhe
e74b5f7bda fix(nan): clear group keys on NAN stop and peer NDP teardown
Fix group-key lifecycle gaps on the secured NDP path:

- On NAN stop, reset the device-global IGTK/BIGTK state via new
  nan_security_reset_own_group_keys() so the next start regenerates fresh
  keys. Previously the one-shot nan_ensure_own_igtk/bigtk kept own_*_set,
  so restart re-installed the stale key with IPN/BIPN=0, resetting the
  blob's monotonic replay counter (and reusing keys if the NMI changed).

- On peer teardown (nan_app_clear_one_peer_tks), remove the peer RX
  IGTK/BIGTK from the blob (they were installed against the peer NMI at
  NDP confirm) and scrub ndl->igtk/bigtk + flags. Previously only the GTK
  was removed, leaving stale BIP keys installed and key bytes in memory.

- Copy the GTK Key RSC into the descriptor only when a GTK KDE is present,
  matching the comment and avoiding stale RSC on an IGTK/BIGTK-only path.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
c2c825299a fix(nan): scrub group keys from stack, demote key hexdumps to DEBUG
Harden group-key material handling on the secured NDP path:

- Zero the stack buffers that hold plaintext/decrypted group keys before
  they leave scope: pad in nan_kek_wrap_key_data, plain in
  nan_append_own_group_kdes (single-exit cleanup), and the decrypted plain
  in esp_nan_parse_ndp_key_desc. Mirrors the existing forced_memzero(pmk)
  scrubs so GTK/IGTK/BIGTK bytes do not persist on the stack.

- Demote the ND-TK / GTK / IGTK / BIGTK ESP_LOG_BUFFER_HEXDUMP calls (own
  keys in nan_security.c, pairwise and peer keys in nan_app.c) from
  ESP_LOG_INFO to ESP_LOG_DEBUG so raw key bytes are not printed at the
  default log level.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
65d822f202 fix(nan): detect ND-TK install failure at NDP confirm
The ND-TK (pairwise data key) install return value was overwritten by the
subsequent NM-TK install before being checked, so an ND-TK failure went
undetected: the NDP was marked accepted and NDP_CONFIRM posted while
unicast data frames had no encryption key installed. Check ND-TK first
and tear down on failure, then install and check NM-TK separately.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
22a9321fea fix(nan): free NDL slot and deny peer when get_mac fails on NDP resp
The NDP indication handler recorded an NDL slot, then on esp_wifi_get_mac
failure unlocked and returned without releasing the slot or answering the
peer: the slot leaked (counting against the NDL limit) and the peer waited
indefinitely. On failure now reset the NDL and send a deny response,
mirroring the existing allocation-failure cleanup path.

Also drop the redundant pre-branch get_mac/IPv6-derive: its result was
only used on the auto-response path, which recomputes it, so on the
indication path it was dead work and a second leak site.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
0577b5b1aa fix(wifi): sync wifi-remote injected header for NAN group_mgmt_prot 2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe
08e98f6f30 feat(nan): pin datapath IPv6 neighbor via esp_netif static entry
- Add esp_wifi_netif_set_static_neighbor() that to add/remove IPv6
  static entry using netif API to skip Neighbor Discovery Protocol
- Move the fe80::/64 + EUI-64 derivation to esp_wifi_netif.c
2026-07-01 18:11:52 +05:30
Sarvesh Bodakhe
932a9e33d8 feat(wifi): add NAN group data and management frame protection
Add Wi-Fi Aware group-key support to secured NDPs so group-addressed
traffic can be protected, for interop with iOS/macOS peers:

- GTK (NCS-GTK-CCM-128) protects group-addressed data.
- IGTK/BIGTK (BIP) protect group management traffic - multicast SDFs,
  Beacons.

Capabilities are advertised in the CSIA IE: group_data_prot maps to GTKSA,
group_mgmt_prot to IGTKSA/BIGTKSA. The CSIA cannot encode IGTK/BIGTK
without GTK (WiFi Aware spec 9.5.21.2, Table 122), so enabling group_mgmt_prot
forces group_data_prot on for every secured service.

Expose per-service group_data_prot and device-global group_mgmt_prot.
2026-07-01 13:35:15 +05:30
Fu Hanxi
59296315b1 Merge branch 'ci/esp-pylib-tests-missing-config' into 'master'
ci: add esp-pylib dependency to check-tests-missing-config pre-commit hook

See merge request espressif/esp-idf!50216
2026-07-01 09:32:39 +02:00
morris
e34e2af9e4 Merge branch 'docs/esp_crc_rom_api' into 'master'
fix(esp_crc): clarify CRC ROM helper usage documentation

Closes IDFGH-17804

See merge request espressif/esp-idf!50177
2026-07-01 15:11:11 +08:00
Mahavir Jain
1c5aa1c5cb Merge branch 'fix/aes_dma_psram_encrypted_mem_s31' into 'master'
fix(mbedtls/aes): Fix AES-DMA over encrypted PSRAM on ESP32-S31

See merge request espressif/esp-idf!49935
2026-07-01 12:16:13 +05:30
Island
3011b74b5f Merge branch 'idf/ble_iso_sec_fixes' into 'master'
Idf/ble iso sec fixes

Closes SEC-1067 and SEC-1184

See merge request espressif/esp-idf!50175
2026-07-01 14:08:35 +08:00
Island
b295d1f227 Merge branch 'fix/fix_ble_rtc_register_issue_after_reset' into 'master'
fix(ble): fix ble rtc reset issues on esp32-h4 and esp32-s31

Closes BLERP-2934, BLERP-2935, and BLERP-2937

See merge request espressif/esp-idf!50057
2026-07-01 14:04:41 +08:00
Hu Rui
03cf5bb45a Merge branch 'refactor/driver_dac_common' into 'master'
refactor(dac): improve the DAC driver

See merge request espressif/esp-idf!48212
2026-07-01 13:36:23 +08:00
Ashish Sharma
131e66a071 Merge branch 'contrib/github_pr_18734' into 'master'
Fix header value truncation detection in httpd_req_get_hdr_value_str (GitHub PR)

Closes IDFGH-17829

See merge request espressif/esp-idf!49833
2026-07-01 10:56:32 +08:00
Rahul Tank
24b90ba6de Merge branch 'contrib/github_pr_18761' into 'master'
fix(nimble): initialize return value in LED characteristic access cal… (GitHub PR)

Closes IDFGH-17862

See merge request espressif/esp-idf!50077
2026-07-01 08:01:40 +05:30
Benedek Brandschott
b33745d104 fix(esp_http_server): report truncation when header value length matches buffer size
httpd_req_get_hdr_value_str() detected truncation with `val_size < full_size`, where full_size is the strlcpy() return value. strlcpy() returns strlen() of the source (the terminating null is not counted), so truncation actually occurs when strlen(src) >= val_size. At strlen(src) == val_size the value is copied as val_size - 1 chars + NUL (i.e. truncated) yet ESP_OK was returned, so the caller never learned the value was cut.

Use `val_size <= full_size` and correct the misleading comment about strlcpy()'s return value.

Same truncation-reporting class fixed for httpd_cookie_key_value in PR #16202; httpd_req_get_hdr_value_str was missed. No memory-safety impact: strlcpy() null-terminates if val_size > 0.
2026-07-01 10:20:19 +08:00
Jiang Jiang Jian
9d263e3725 Merge branch 'feat/nd6_static_neighbor_entries' into 'master'
feat(lwip): Add IPv6 static neighbor cache entry support

See merge request espressif/esp-idf!49961
2026-06-30 23:34:17 +08:00
sonika.rathi
c76664ce66 ci: add esp-pylib dependency to check-tests-missing-config pre-commit hook 2026-06-30 16:41:46 +02:00
Sudeep Mohanty
8541991224 Merge branch 'fix/lp_spi_driver_and_tests' into 'master'
fix(ulp/lp_spi): fix stale data in driver

Closes IDF-11471, IDF-11472, and IDFCI-10465

See merge request espressif/esp-idf!48972
2026-06-30 15:50:26 +02:00
Sudeep Mohanty
ddaa9699b3 Merge branch 'fix/lp_periph_init_fail_with_cpp' into 'master'
fix(ulp): make LP peripheral default config macros C++ compatible

Closes IDFGH-17404

See merge request espressif/esp-idf!49950
2026-06-30 15:36:38 +02:00
Mahavir Jain
195a88db1a Merge branch 'fix/panic_spiram_xip_irom_drom_alignment_no_gap' into 'master'
Handle absent IROM/DROM alignment gap in SPIRAM-XIP memprot tests

Closes IDFCI-5004, IDFCI-11739, and IDFCI-11738

See merge request espressif/esp-idf!50133
2026-06-30 18:16:52 +05:30
Mahavir Jain
cb33ab16b3 Merge branch 'contrib/github_pr_18684' into 'master'
feat(httpd): avoid useless string copy by introducing httpd_req_get_url_query_str_ptr() (GitHub PR)

Closes IDFGH-17758

See merge request espressif/esp-idf!49682
2026-06-30 18:15:48 +05:30
Jiang Jiang Jian
9bd49630fc Merge branch 'bugfix/clear_ifx_tx_queue' into 'master'
bugfix(wifi): Clear Sta TX queue to prevent key 2 send failure

Closes WIFIBUG-745 and WIFIBUG-1597

See merge request espressif/esp-idf!40211
2026-06-30 19:47:15 +08:00
Fu Hanxi
ae7898bb14 Merge branch 'fix/mspi_pre_commit_fix' into 'master'
fix(spi_flash): remove mspi_test xip_psram test with missing config to fix check_pre_commit job

See merge request espressif/esp-idf!50159
2026-06-30 12:58:48 +02:00
akshat
f4708595e6 bugfix(wifi): Clear Sta TX queue to prevent key 2 send failure
Also, Ensure correct return values for key 2 and key 4.
2026-06-30 14:56:15 +05:30
Martin Vychodil
943602c0ac Merge branch 'bugfix/idf-15334-normalize-partition-table-cli' into 'master'
fix(partition_table): normalize CLI output with esp-pylib

Closes IDF-15334

See merge request espressif/esp-idf!49989
2026-06-30 17:10:52 +08:00
Martin Vychodil
7d515c1e2e Merge branch 'bugfix/idfci-12308-fatfs-bdl-test-stack-overflow' into 'master'
fix(fatfs): avoid stack overflow in BDL diskio partition test

Closes IDFCI-12308

See merge request espressif/esp-idf!49895
2026-06-30 16:58:56 +08:00
Jiang Jiang Jian
936083c626 Merge branch 'feat/pasn_verification' into 'master'
feat(nan): Add changes for nan pasn verification

See merge request espressif/esp-idf!49694
2026-06-30 16:58:13 +08:00
Martin Vychodil
caf132aaf0 Merge branch 'bugfix/idfci-8839-remove-orphan-test-configs' into 'master'
fix(fatfs): re-enable fatfs and vfs psram/ccomp CI tests

Closes IDFCI-8839

See merge request espressif/esp-idf!49986
2026-06-30 16:55:51 +08:00
cjin
1c17dee316 fix(ble): fix ble timer reset issues on ESP32-H4 2026-06-30 16:30:14 +08:00
cjin
96cecd67e1 fix(ble): fix ble timer reset issues on ESP32-S31 2026-06-30 16:30:11 +08:00
Sudeep Mohanty
ae1386e891 test(ulp/lp_spi): improve test stability and add cleanup
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 10:21:56 +02:00
Sudeep Mohanty
a019532119 fix(ulp/lp_spi): fix driver bugs and add bus deinit API
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 10:21:34 +02:00
morris
aa4532395a fix(esp_crc): clarify CRC helper usage documentation
Document the implicit bitwise inversion behavior in the CRC ROM wrappers
and add regression tests covering continuous-buffer examples.

Closes https://github.com/espressif/esp-idf/issues/18715
2026-06-30 15:37:06 +08:00
Nachiket Kukade
17ff376098 bugfix(nan): Fix hard/soft reset cases in NAN Pairing verification
- Update pairing complete API to record for peer
- Terminate NAN Datapaths using publish_id after receiving PASN M1
2026-06-30 12:58:44 +05:30
Sajia
c18887b05c feat(nan): Add support for NAN Pairing Verification
- Add nira attr and verification for pasn auth frames
- Refine key clearing and pairing complete logic for pasn verify
- Add NIRA own-service resolution, cached NIK checks, and dynamic
  pairing IE construction for bootstrap vs verify paths.
- Replace NAN bootstrap events by private callbacks
2026-06-30 12:58:41 +05:30
Jiang Jiang Jian
8b8a2115e4 Merge branch 'bugfix/fix_tx_issues_introduced_by_keep_alive_opt' into 'master'
bugfix/fix tx issues introduced by keep alive opt

Closes WIFIBUG-1991, WIFIBUG-1999, and WIFIBUG-1994

See merge request espressif/esp-idf!50108
2026-06-30 15:16:07 +08:00
Harshal Patil
3bd70e2c34 Merge branch 'change/secure_boot_signing_key_type_check' into 'master'
Validate secure boot signing key type at configure time

See merge request espressif/esp-idf!49529
2026-06-30 12:31:42 +05:30
cjin
958c28c41d fix(ble): change min freq in ble power save 2026-06-30 15:01:34 +08:00
Linyan Liu
c7b53c9a97 fix(ble_iso): Fix null dereference may happened during BIG/CIG creation 2026-06-30 14:38:09 +08:00
Konstantin Kondrashov
1d7bfe4c3f Merge branch 'fix/esp_image_format' into 'master'
fix(esp_image_format): Fix some memory-safety issues

Closes IDF-15801 and SEC-1158

See merge request espressif/esp-idf!49675
2026-06-30 09:19:17 +03:00
Linyan Liu
caf9a41581 fix(ble_iso): Fix ISO SDU header pulled without minimum length check 2026-06-30 12:13:32 +08:00
Li Shuai
d69aed64ad Merge branch 'feat/pm-788' into 'master'
support sleep retention destroy callback

Closes PM-788

See merge request espressif/esp-idf!49568
2026-06-30 11:55:57 +08:00
Island
6aa3757930 Merge branch 'idf/ble_audio_4.4.1' into 'master'
feat(ble_audio): Support Zephyr LE Audio v4.4.1

See merge request espressif/esp-idf!49780
2026-06-30 11:49:45 +08:00