Commit Graph

145 Commits

Author SHA1 Message Date
Rahul Tank 700181eb1f fix(nimble): Bugfixes for various issues 2026-02-16 11:35:20 +05:30
Rahul Tank cde7b7362a fix(protocomm): Add security checks for buffer overflow and incorrect length handling 2025-12-18 17:06:08 +05:30
Mahavir Jain 757af50058 fix(protocomm): add validation for Security1 client verifier data
Add checks to validate client_verify_data pointer and length before
processing in handle_session_command1. Prevents NULL pointer dereference
when client omits verifier data in Session_Command1, which could cause
device crash during provisioning (remote DoS attack).

We would like to thank Pavel Kohout from Aisle Research for reporting
this vulnerability along with a mitigation strategy.
2025-11-27 10:15:55 +05:30
Rahul Tank b89bf2dcc6 fix(nimble): Address compilation issues in nimble examples 2025-10-29 21:17:39 +05:30
Mahavir Jain 43926143f8 feat(protocomm): add (hidden) config option to indicate security patch feature 2025-03-17 13:35:03 +05:30
Mahavir Jain c18de74f77 fix(provisioning): fix incorrect AES-GCM IV usage in security2 scheme
Using same IV in AES-GCM across multiple invocation of
encryption/decryption operations can pose a security risk. It can help
to reveal co-relation between different plaintexts.

This commit introduces a change to use part of IV as a monotonic
counter, which must be incremented after every AES-GCM invocation
on both the client and the device side.

Concept of patch version for a security scheme has been introduced here
which can help to differentiate a protocol behavior for the provisioning
entity. The security patch version will be available in the JSON
response for `proto-ver` endpoint request with the field
`sec_patch_ver`.

Please refer to documentation for more details on the changes required
on the provisioning entity side (e.g., PhoneApps).
2025-03-10 10:01:44 +05:30
Mahavir Jain 70a2ea14f4 fix(protocomm): memory leak issue for session command0 failure case 2025-03-10 10:01:41 +05:30
Mahavir Jain 4fb04ce3aa Merge branch 'bugfix/add_notify_flag_for_wifi_prov_v5.2' into 'release/v5.2'
fix(wifi_prov): Add notify characteristic flag support (v5.2)

See merge request espressif/esp-idf!33184
2024-09-26 11:44:06 +08:00
Rahul Tank 75cec307f1 fix(nimble): Add notify characteristic flag support 2024-09-05 16:19:31 +05:30
Rahul Tank d8004c197d fix(wifi_prov): Add support for ESP IP controller chips in bluedroid 2024-08-29 15:05:37 +05:30
Rahul Tank 916d319155 fix(wifi_prov): Use calloc instead of malloc to zero initialize variable 2024-08-02 10:36:38 +05:30
Rahul Tank 59aa45ad23 fix(wifi_prov): Added API to set random address 2024-07-24 20:56:35 +05:30
zhiweijian 7e97c5fb16 fix(ble/bluedroid): Remove esp_bluedroid_init() discard declaration 2024-04-30 12:02:45 +08:00
Laukik Hase 8582b27f1d refactor(protocomm): Make the protocomm proto-c headers public 2024-03-01 10:26:23 +05:30
Marius Vikhammer bab0fa8a03 ci(test_apps): limit dependencies for misc test_apps
Only pull in direct dependencies for the test apps, reducing build time
as well making it possible for CI to determine if the test should run or not
when dependencies are changed.
2024-02-21 09:34:29 +08:00
Vikram Dattu 2b475022c5 fix(esp_srp): Use @file for file documentation and missing doc
Using @brief for file description wrongly associates the documentation to an API.
Correct way to add file description is to use `@file` and then `@brief`. Corrected the same.

- Also added missing doc for esp_srp_handle_t
2023-12-19 13:12:11 +05:30
Vikram Dattu 541b665b9f feat(provisioning): Generate Salt and verifier pair for given username and password
This commit adds a new feature to generate a salt and verifier pair for a given username and
password during the provisioning process. This is useful in scenarios where the pairing pin is
randomly generated and shown via some interface such as a display or console.

- Uses the provided username and password to generate a salt and verifier pair
- Adds support for dev mode where the pin/password can still be read from flash
2023-11-23 14:25:53 +05:30
Vikram Dattu ee65ea9fb7 refactor(esp_srp): Expose esp_srp.h and add API docs
- Also added missing `protocomm_security2` reference in `protocomm.rst`
2023-11-23 14:25:53 +05:30
Jiang Jiang Jian 9b5be39b0f Merge branch 'feature/protocomm_update_params_v5.2' into 'release/v5.2'
fix(protocomm): added Protocomm BLE Event Structure and Event Handling (v5.2)

See merge request espressif/esp-idf!26898
2023-11-09 12:16:52 +08:00
darshan 83f4025a92 fix(protocomm): added Protocomm BLE Event Structure and Event Handling 2023-11-03 11:42:30 +05:30
Jin Cheng b9ed6f722b feat(bt/bluedroid): Added mode to use BlueDroid host only without Bluetooth Controller 2023-11-02 11:10:24 +08:00
Zim Kalinowski fa1a3ce0b5 Merge branch 'refactor/components_linux_compatible' into 'master'
Exclude all currently incompatible components from Linux build

Closes IDF-8318 and IDF-5996

See merge request espressif/esp-idf!25598
2023-10-18 20:17:49 +08:00
Jakob Hasse 548022fbe6 refactor(linux): excluded all non-Linux components from build
* All components which won't build (yet) on Linux are excluded.
  This enables switching to Linux in an application without
  explicitly setting COMPONENTS to main in the main
  CMakeLists.txt.
* ESP Timer provides headers for Linux now
* automatically disabling LWIP in Kconfig if it is not available

doc(linux): brought section
  "Component Linux/Mock Support Overview" up to date
2023-10-16 17:06:54 +08:00
Niklas Kaaf 2d6dcee136 fix: "erro code" -> "error code" typos
Closes https://github.com/espressif/esp-idf/pull/12330
2023-10-13 18:13:54 +08:00
WanqQixiang 5435c9b04a fix(protocomm): Remove the configuration check of wifi_provisioning for protocomm component 2023-09-25 15:32:03 +08:00
liqigan 0df585dc35 feat(bt/bluedroid): Add new version of API for Bluedroid host stack initialization 2023-08-31 12:28:38 +00:00
Armando 7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
KonstantinKondrashov e72061695e all: Removes unnecessary newline character in logs
Closes https://github.com/espressif/esp-idf/issues/11465
2023-06-09 03:31:21 +08:00
Laukik Hase f695c1a788 wifi_prov: Exposed events for secure session establishment 2023-05-23 12:00:40 +05:30
isha.pardikar@espressif.com f29430239c wifi_prov_mgr: Fixed memory leak after bluetooth stack was stopping. 2023-04-24 17:45:41 +05:30
Marius Vikhammer 75591a8a13 Merge branch 'ci/driver_single_board' into 'master'
ci: update test apps to use run_all_single_board_cases

See merge request espressif/esp-idf!22669
2023-03-13 09:25:42 +08:00
Marius Vikhammer 0be8e03907 ci: update test apps to use run_all_single_board_cases 2023-03-10 14:27:09 +08:00
isha.pardikar@espressif.com e72d223737 wifi_prov_mgr : Fixed return value of characteristic read operation 2023-03-06 15:23:26 +05:30
Alexey Lapshin a7e51b2509 protocomm: fix gcc-12 compile errors 2023-02-22 05:33:03 +00:00
Omar Chebib 5e5343d429 TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-02-17 11:22:25 +08:00
Rahul Tank 826495a145 Nimble: Added return value (success / failure ) to nimble_port_init 2023-01-31 12:01:02 +05:30
Laukik Hase 7759079362 protocomm: Fix Kconfig dependency on wifi_provisioning component config
- `protocomm` depends on a config option `CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION`
  from `wifi_provisioning`; however, a lower layer component (`protocomm`) should
  not have any `#ifdef` guard dependent on an upper layer component (`wifi_provisioning`).
- Added a new `ble_link_encryption` flag in `protocomm_ble_config_t` to manage the same

Closes https://github.com/espressif/esp-idf/issues/9443
2023-01-20 11:01:01 +05:30
Cao Sen Miao 94120b82c2 esp32h2: add build test 2023-01-17 10:29:04 +08:00
Laukik Hase 68d90dd392 protocomm: Fix test-app build for esp32c2 & esp32c6
- AES context has a breaking change, rather than storing
  round keys directly, it stores the offset at which the keys
  are present in the context buffer
2023-01-09 15:41:36 +05:30
Mahavir Jain 3a56807568 protocomm: remove "Wno-format" cflag and fix formatting errors 2022-12-21 14:13:55 +05:30
Mahavir Jain a2616c0ab5 protocomm: fix multiple coverity warnings
- comparing array with NULL
- dereferencing null pointer
- resource leak
2022-11-08 15:50:42 +05:30
Mahavir Jain 99579620b2 Merge branch 'feature/wifi_prov_event_transport_paired' into 'master'
wifi_prov: Exposed events for transport pairing and disconnection

Closes IDFGH-8557

See merge request espressif/esp-idf!20821
2022-11-01 17:39:28 +08:00
Laukik Hase e6171b7338 wifi_prov: Exposed event for transport pairing
Closes https://github.com/espressif/esp-idf/issues/10007
2022-11-01 10:06:30 +05:30
Song Ruo Jing be0fdfa176 soc: Add a soc cap, SOC_CLK_RC_FAST_D256_SUPPORTED, for whether the target has the RC_FAST_D256 clock 2022-11-01 11:23:26 +08:00
Laukik Hase c7142f274b protocomm: Increase Bluedroid-BLE maximum buffer size
- For the security2 scheme, the payload size is quite larger
  than that for security1.
2022-10-26 13:34:39 +05:30
Aditya Patwardhan acc3dc8bd2 protocomm/esp_srp: Allocate memory for username only when the
verification is successful
2022-10-07 18:27:07 +05:30
Aditya Patwardhan 68947b5944 protocommm/esp_srp: Fix small issues reported by coverity. 2022-10-07 18:27:07 +05:30
Aditya Patwardhan 244f4ce1d9 protocomm: Enable security version 2 by default 2022-09-30 16:53:20 +05:30
Laukik Hase d7eb2c7b4e mbedtls: MBEDTLS_PRIVATE & MBEDTLS_ALLOW_PRIVATE_ACCESS-related cleanup 2022-09-29 10:13:14 +05:30
Laukik Hase b7ae23856a protocomm: MBEDTLS_PRIVATE & MBEDTLS_ALLOW_PRIVATE_ACCESS-related cleanup 2022-09-29 10:13:13 +05:30