Commit Graph

5286 Commits

Author SHA1 Message Date
Rahul Tank 20ddbe4a0d fix(nimble): Add header file to expose macros 2026-03-04 11:58:35 +05:30
Shreeyash 8b13cff2e2 fix(nimble): Fix host init assert when periodic sync is disabled 2026-02-03 12:42:17 +05:30
Rahul Tank 068f3b56b5 fix(nimble): Added change to copy adv params to be reused during reattempt adv 2026-02-03 12:41:42 +05:30
Rahul Tank 89fd215ed5 fix(nimble): Fixed duplication of HCI record entry HCI logging 2026-02-03 12:40:46 +05:30
Andrzej Kaczmarek f6bb6468e2 nimble/host: Fix L2CAP unit tests
This fixes L2CAP unit tests after latest rework.
2026-02-03 12:39:19 +05:30
Andrzej Kaczmarek 4f5675f517 nimble/host: Rework L2CAP RX
This reworks L2CAP RX path to simplify flow and fix reassembly issues.

RX is now done in conn context instead of chan context. This allows to
save few bytes of memory per chan since RX data are now held per-conn
instead of per-chan.

The new code also fixes reassembly issue where we couldn't properly
reassemble L2CAP SDU if the first fragment was shorter than the L2CAP
header.
2026-02-03 12:39:04 +05:30
Rahul Tank eed4636870 fix(nimble): Address security vulnerabilties and NVS corruption issues.
Security Issues Fixed:

1. Buffer Overflow Prevention (ble_store_nvs.c)
- Changed all sprintf() calls to snprintf() in get_nvs_key_string()
  to prevent potential buffer overflow when generating NVS key strings
- Changed index parameter type from int8_t to int in ble_nvs_delete_value()
  to handle values > 127 correctly

2. Bounds Checking (ble_store_nvs.c)
- Added bounds checking in populate_db_from_nvs() before each memcpy
  operation to prevent buffer overflow when NVS contains more entries
  than RAM arrays can hold (due to config mismatch or NVS corruption)

3. Array Index Validation (ble_store_nvs.c)
- Fixed potential array index -1 access in ble_nvs_restore_sec_keys()
  by adding checks before accessing [num - 1] indices
- Fixed loop bounds to use actual populated count instead of max config value

4. NVS Data Size Validation (ble_store_nvs.c)
- Added get_expected_size_for_obj_type() helper function
- Added size validation in get_nvs_db_value() and get_nvs_peer_record()
  to detect corrupted or version-mismatched NVS data before reading

5. Type Safety Fix (ble_store_config_conf.c)
- Fixed critical typo: && to & for ble_store_config_num_csfcs
- Added missing union members (csfc, ead) in ble_store_config_conf_export()

6. Thread Safety (ble_gattc_cache.c)
- Replaced static buffer with thread-local storage (__thread) in getKeyname()
- Changed sprintf() to snprintf() with explicit size limit
- Increased buffer size from 16 to 20 bytes for safety margin
2026-02-03 12:35:05 +05:30
Rahul Tank 62b826c2f8 fix(nimble): Add extra logs to track critical failures 2026-02-03 12:34:32 +05:30
Rahul Tank 918ae0721b fix(nimble): Fix coverity reported issue
Handled unchecked return value in ble_hs_pvcy.c
2026-02-03 12:33:41 +05:30
Astha Verma 58e43f9e60 fix(nimble): Fix early cleanup when periodic sync reattempts exhausted 2026-02-03 11:57:49 +05:30
Astha Verma 039d2d62ed fix(nimble): fix esp_hid_device example when static_to_dynamic enabled 2026-01-21 16:46:54 +05:30
Astha Verma bec112ac57 fix(nimble): Support for concatenation of same type UUID during adv data parsing 2026-01-21 16:44:29 +05:30
Astha Verma 39c8b6a835 fix(nimble): Reset HID services during deinit 2026-01-21 16:44:29 +05:30
Rahul Tank 883c9ebed0 fix(nimble): Fix memory leak in controller/stack deinit sequence 2026-01-19 11:39:36 +05:30
cjin 886039b39b feat: add vs cmd support for adv constant did and scan adi filter 2026-01-16 12:51:28 +05:30
Astha Verma d9a6fa8630 fix(nimble): Handling of psync during synchronization timeout (0x3e) 2026-01-14 13:38:16 +05:30
zhanghaipeng 24ce0703da fix(nimble): use pre-allocated buffer for HCI logging 2026-01-05 10:37:20 +08:00
Rahul Tank 112925dfe7 fix(nimble): Add API to find identity address for given RPA address 2025-12-31 18:57:14 +05:30
Sumeet Singh c443bdb4ac feat(nimble): Support for getting the currently using local IRK 2025-12-31 12:47:47 +05:30
Rahul Tank e2f8239def fix(nimble): Memory optimization + dynamic memory support 2025-12-24 12:27:49 +05:30
Astha Verma 450d35aae0 fix(nimble): Modify GATT data storage struture in NVS during gatt caching 2025-12-23 21:21:32 +05:30
Rahul Tank 445bdeb281 feat(nimble): Add support for static passkey 2025-12-19 16:01:08 +05:30
Ashish Sharma 872f3c1849 feat: support mbedTLS 3.6 and 4.0 2025-12-18 10:12:13 +05:30
Ashish Sharma 0288e3987a feat(bt): migrate mbedTLS to PSA APIs 2025-12-18 10:12:13 +05:30
Rahul Tank 686728c09e fix(nimble): Add missing header file to fix compilation issue 2025-12-16 12:14:30 +05:30
cjin 32e8ddac58 fix: fix set pawr subev data exceeds 255 2025-12-11 08:43:41 +08:00
Rahul Tank 9551ac31af fix(nimble): Add change to cancel sync in case of reattempt 2025-12-02 11:55:30 +05:30
Rahul Tank 6f9ff29d26 fix(nimble): Add a check for psync before processing 2025-11-24 08:27:25 +05:30
chenjianhua c6709f6efa feat(ble/nimble): support runtime allocation for mempool 2025-11-17 15:26:09 +08:00
Rahul Tank 8fd41d86c4 fix(nimble): Address compilation issues in nimble examples 2025-10-30 10:54:07 +05:30
Rahul Tank 4538733010 feat(nimble): Add support for HCI commands / events
1. Read all local supported feature
  2. Read remote supported feature
  3. Advertising monitor.
2025-10-23 09:50:01 +05:30
Shreeyash 9464ecd6e3 fix(nimble):fix array overflow caused by invalid connection handle indexing 2025-10-15 15:57:37 +05:30
Abhinav Kudnar 2d69e13657 feat(nimble): Added BLE CS Service 2025-10-14 12:08:12 +05:30
Magdalena Kasenberg 5b55424c20 nimble/host: Add initial support for Channel Sounding HCI commands and
events
2025-10-14 12:08:12 +05:30
Rahul Tank 6e6089e62b fix(nimble): Use nimble platform mem malloc / free APIs 2025-10-09 10:37:04 +05:30
Rahul Tank 91b8591f05 fix(nimble): Address mbuf from different chains traversal during copying 2025-10-03 14:24:13 +05:30
Rahul Tank 94d14eded8 fix(nimble): Avoid ext adv data in reattempt advertising 2025-09-24 09:27:58 +05:30
Rahul Tank 13fb336638 fix(nimble) Added code to handle sending indicate when only gattc/gatts role is enabled 2025-09-22 21:45:16 +05:30
Astha Verma d23b04ec95 fix(nimble): Fixed incorrect HCI status in connect event 2025-09-15 10:52:15 +05:30
Rahul Tank beddfae7cd fix(nimble): Fixed reattempt count handling for perdiodic adv 2025-09-04 11:56:56 +05:30
Rahul Tank 48ca84312e fix(nimble): Add code to post connection failure
In event of a corner case, where connection is not completed,
connection reattempt is disabled, so need to post connection
failure event to application to make it aware of the failure
2025-08-22 14:22:32 +05:30
Shen Weilong eff7e89519 Invoke ble_transport_ll_init() after ble_transport_hs_init() 2025-08-20 16:04:30 +05:30
Astha Verma db2f236ec1 fix(nimble): Added missing api in nimble which is present in bluedroid 2025-08-19 12:19:41 +05:30
Liu Linyan 550ce6a646 feat(ble): ISO minor support for NimBLE Host 2025-08-12 15:29:12 +08:00
Sumeet Singh b04e3d1e96 fix(nimble): Update ble_gatts_show_local with CPFDs and CAFDs 2025-08-11 17:27:08 +05:30
Rahul Tank d59bb2debc fix(nimble) Add VSC for Set Scan Channel Bitmap for esp32c2 2025-08-08 11:27:35 +05:30
Astha Verma b45dcedcaf fix(nimble): Handle count correctly by considering offset. 2025-08-05 14:25:19 +05:30
Astha Verma d4e8e43b26 fix(nimble): Updating the count parameter when fetching gatt db 2025-07-30 11:29:45 +05:30
Rahul Tank 9d164c2b1b fix(nimble): Added code under correct flags
Code was not under correct flag. Hence if flag is disabled, then
compilation warnings are observed. Fixed the same

Based on PR : https://github.com/espressif/esp-nimble/pull/107
2025-07-28 10:19:29 +05:30
Sumeet Singh 3e47acb1e4 fix(nimble): Clear GATT service entries counter upon GATT deinit 2025-07-11 17:45:11 +05:30