Commit Graph

178 Commits

Author SHA1 Message Date
Chen Jichang
3c3b9a6a4e ci(esp32h4): disable tests which cannot pass 2026-05-11 16:48:58 +08:00
Jim
688eef5dff fix(protocomm): Add GATT service initialization that when gatt service changed, the peer can refresh gatt service 2026-05-09 10:24:08 +08:00
Mahavir Jain
35fe22582a Merge branch 'fix/protocomm-security2-srp-hd-double-free' into 'master'
fix(protocomm): null srp_hd after free in sec2 command0 error paths

Closes IDF-15579

See merge request espressif/esp-idf!47888
2026-04-27 08:50:20 +05:30
Mahavir Jain
322eabd390 fix(protocomm): null srp_hd after free in sec2 command0 error paths
handle_session_command0() freed cur_session->srp_hd on every error path
without clearing the pointer. A subsequent sec2_close_session() call
(e.g. on BLE disconnect, or via sec2_new_session evicting the old
session) checks `if (cur_session->srp_hd)` and frees it again,
double-freeing a dangling pointer.
2026-04-23 13:43:09 +05:30
Aditya Patwardhan
bf56fad62d Merge branch 'fix/protocomm-close-session-id-mismatch' into 'master'
fix(protocomm): pass current session id when closing existing session

See merge request espressif/esp-idf!47562
2026-04-21 19:55:01 +05:30
Aditya Patwardhan
9dc64a7402 fix(protocomm): pass current session id when closing existing session
sec1_new_session()/sec2_new_session() were calling sec*_close_session()
with the *new* session_id parameter instead of the existing
cur_session->id. The close handler validates `cur_session->id ==
session_id` before performing teardown, so the call always failed with
ESP_ERR_INVALID_STATE.

Effect: when a peer started a new provisioning session while another was
already active, the previous session's PSA keys, AES context, SRP handle
and username buffer were leaked instead of being destroyed. The cleared
session struct was overwritten by the new session, leaking the previous
key handles inside PSA Crypto and (for security2) leaking heap memory
for the username and SRP context.

Fix: pass cur_session->id so the close path actually executes the
teardown (psa_destroy_key/psa_cipher_abort/esp_srp_free/free) before the
new session takes over.
2026-04-14 11:05:51 +05:30
Ashish Sharma
14731c19f0 fix(esp_srp): reject SRP client public key when A mod N is zero 2026-04-10 17:12:53 +08:00
Ashish Sharma
a2f4554f10 fix(protocomm): fixes potential issues that can lead to crash during device provisioning 2026-04-01 10:08:00 +08:00
Rahul Tank
9e581d7d68 fix(nimble): Bugfixes for various issues 2026-02-16 10:53:34 +05:30
Mahavir Jain
ecc8fda914 Merge branch 'bugfix/esp_local_ctrl_arg_check' into 'master'
fix(esp_local_ctrl): validate payload_case matches msg_type in command dispatcher

See merge request espressif/esp-idf!45817
2026-02-13 09:13:16 +05:30
Mahavir Jain
4631b4a5d9 docs(protocomm): recommend using security2 scheme for production purpose 2026-02-11 13:55:44 +05:30
Alexey Lapshin
72a3697c6c fix(protocomm): fix error handling for esp_srp_exchange_proofs() 2026-02-06 14:21:25 +07:00
harshal.patil
e9ea55bea2 feat(mbedtls/ecdsa): Introduce PSA ECDSA driver 2026-01-19 09:14:37 +05:30
Ashish Sharma
773411a9b0 feat: migrates protocomm to PSA APIs 2025-12-30 09:31:49 +05:30
Rahul Tank
47552ff4fd fix(protocomm): Add security checks for buffer overflow and incorrect length handling 2025-12-16 10:16:05 +05:30
C.S.M
f405e51784 ci(esp32s31): Add ci build test for esp32s31 2025-12-11 15:17:15 +08:00
Mahavir Jain
9c6f6c7470 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).
2025-11-20 14:22:40 +05:30
Rahul Tank
2738c5ac76 fix(nimble): Address compilation issues in nimble examples 2025-10-30 10:54:36 +05:30
WanqQixiang
6b503d0db5 component: Remove wifi_provisioning component and esp_prov tool 2025-09-26 09:48:50 +08:00
Mahavir Jain
c91dc3f049 Merge branch 'cleanup/remove_deprecated_apis' into 'master'
feat: remove some deprecated APIs from 6.0 release

Closes IDF-13093

See merge request espressif/esp-idf!41211
2025-08-21 10:05:37 +05:30
Wang Meng Yang
7cac735da0 Merge branch 'feat/remove_the_deprecated_api_and_parameter' into 'master'
feat(bt): remove the deprecated functions and parameters

Closes BT-4042

See merge request espressif/esp-idf!40435
2025-08-20 19:36:37 +08:00
Mahavir Jain
42914e01ee feat: remove some deprecated APIs from 6.0 release 2025-08-20 14:20:37 +05:30
Marek Fiala
9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
gongyantao
179a730a03 feat(bt): remove the deprecated functions and parametes 2025-08-19 16:07:05 +08:00
Mahavir Jain
f9e2ebaea5 feat(protocomm): disable security version 0 and 1 by default
Change default values for protocomm security configuration options to improve
security:
- CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0 now defaults to 'n'
- CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1 now defaults to 'n'

This reduces code size by default and encourages use of more secure protocomm
implementations.
Projects using these security versions must explicitly enable them in their
configuration.
2025-08-12 11:43:12 +05:30
Marius Vikhammer
bf84ab652a change(test_utils): moved test_utils component to tools/test_apps/components/ 2025-07-21 14:05:50 +08:00
Shen Meng Jing
62d4115e08 docs: Fix some typos 2025-04-30 18:35:39 +08:00
Chen Jichang
c34b4eb882 feat(esp32h4): enable ESP32H4 ci build 2025-03-28 14:41:28 +08:00
Mahavir Jain
2fcceb01a7 feat(protocomm): add (hidden) config option to indicate security patch feature 2025-03-17 10:20:01 +05:30
Mahavir Jain
3bd5a22f5a 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-07 13:49:10 +05:30
Mahavir Jain
641f461346 fix(protocomm): memory leak issue for session command0 failure case 2025-03-07 13:49:09 +05:30
igor.udot
daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
gaoxu
5ef4f20778 feat(esp32h21): disable unsupported build test 2025-02-06 15:47:51 +08:00
hrushikesh.bhosale
e9844bd613 fix(protocomm): Added check for cur_cookie_session_id
Added check to check whether the value of cur_cookie_session_id
is -1 or not, if yes the return with error log message
2024-12-03 14:48:46 +05:30
Ivan Grokhotkov
68e9bcbf1e fix(build): clean up dependencies on driver component 2024-11-07 13:09:23 +01:00
Rahul Tank
fb55646270 fix(nimble): Add notify characteristic flag support 2024-09-05 16:16:08 +05:30
Rahul Tank
338d9f40d9 fix(wifi_prov): Add support for ESP IP controller chips in bluedroid 2024-08-29 14:56:46 +05:30
shreeyash
6e6fd2f6a3 fix(wifi_prov_mgr): Api to keep BLE on after provisioning 2024-08-13 12:42:35 +05:30
Rahul Tank
35e88684db fix(wifi_prov): Use calloc instead of malloc to zero initialize variable 2024-08-02 10:33:28 +05:30
Rahul Tank
928117e999 fix(wifi_prov): Added API to set random address 2024-07-21 15:37:37 +05:30
wanlei
3cf069c7d8 feat(esp32c61): disable unsupported build test 2024-07-16 16:06:19 +08:00
zhiweijian
b9a1756202 fix(ble/bluedroid): Remove BLE functions discard declaration
fix(nt/bluedroid): Split the device name set functions

feat(bt/bluedroid): added APIs to get/set device name on BT GAP side

change(bt/common): Marked some APIs in device module as deprecated

1. esp_bt_dev_set_device_name
2. esp_bt_dev_get_device_name

change(bt/bluedroid): use BT GAP APIs to set/get device name in bluetooth classic examples

change(bt/bluedroid): use BT/BLE GAP APIs to set/get device name in coexist examples
2024-04-18 15:53:54 +08:00
zhiweijian
5725595d84 fix(ble/bluedroid): Remove esp_bluedroid_init() discard declaration 2024-04-18 15:53:30 +08:00
laokaiyao
65b1fd33d3 ci(esp32c5mp): disable the unsupported tests 2024-04-07 12:13:29 +08:00
Laukik Hase
379e02ec9c refactor(protocomm): Make the protocomm proto-c headers public 2024-02-28 14:35:04 +05:30
Marius Vikhammer
1f7c666701 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-18 16:01:58 +08:00
Wang Meng Yang
4c8f6c5458 Merge branch 'feat/add_get_device_name_api' into 'master'
feat(bt/bluedroid): Added API to get local device name

Closes BT-3526

See merge request espressif/esp-idf!27667
2023-12-27 10:37:33 +08:00
Jin Cheng
a3f68aef8a feat(bt/bluedroid): Added API to get local device name 2023-12-15 19:30:12 +08:00
Vikram Dattu
ec1057a05a 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-15 12:28:17 +05:30
Vikram Dattu
08f2422ff8 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-21 18:06:24 +05:30