Commit Graph

3870 Commits

Author SHA1 Message Date
Rahul Tank a6c81aed76 Added checks to disable stack callback registered with controller during
stack deinit
2022-12-01 18:39:10 +05:30
Prasad Alatkar 0129305aaf NimBLE AFR: Fix conn_handle related bug in pairing request 2022-10-03 18:29:29 +05:30
Prasad Alatkar fc400b07a9 NimBLE: Add ble_gap_pairing_req GAP event to accept or reject pairing request 2022-10-03 18:27:18 +05:30
Roshan Bangar 93149d961d Changed debug log level of a print to avoid extra unwanted console prints. 2022-09-13 12:57:52 +05:30
Rahul Tank acd6e0cea6 Nimble: Fixed memory corruption introduced in reconnection attempt code 2022-08-24 13:42:38 +05:30
Rahul Tank dac3a2a0f5 Added check to free keypair if already allocated to avoid memory leak 2022-06-28 14:15:04 +05:30
Szymon Janc 6a4a33b3b5 nimble/host: Sync sending Host Number of Completed Packets command
Host Number of Completed Packets command is special as it doesn't
generate status event and thus is not send with ble_hs_hci_cmd_tx.

We should stil sync sending it with ble_hs_hci_cmd_tx() though to
avoid requesting more than one command buffer from HCI transport
(which may not be able to provide more).
2022-06-21 16:40:20 +05:30
Onkar 4f059ec4fa Bugfix: fix re-pairing issue 2022-05-24 15:25:42 +05:30
Anton Maklakov e6cc38908c crypto.h: correct function declaration 2022-03-03 04:10:06 +00:00
Laukik Hase 51f4b84aca ble_sm_alg.c: Added changes for mbedTLS v3.1.0
- Added MBEDTLS_PRIVATE for accessing private struct members wherever necessary
- Added macros for version check for backward compatibility
2022-02-22 07:56:12 +00:00
Rahul Tank 1dc1ec6e76 Nimble: Check stack initialization status before executing stack command
Previous commit added checks in some functions that can be called
without stack initalization. Corrected such instances.
2022-02-18 11:45:27 +05:30
wangmengyang 554cd264cd fixed memory leak for ble_hs_flow_timer and ble_hs_stop_terminate_tmo 2021-12-17 15:40:07 +08:00
Wang Meng Yang 8869cf6ba6 Merge branch 'bugfix/add-esp-timer-guard-check-in-port-layer' into 'nimble-1.3.0-idf'
NimBLE: Invoke xTimerGetExpiryTime in npl porting layer only when freertos timer is used

See merge request espressif/esp-nimble!117
2021-12-05 08:08:50 +00:00
Sudeep Mohanty 2ea6af6e64 NimBLE: Invoke xTimerGetExpiryTime in npl porting layer only when freertos timer is used
This commit adds an esp timer guard check to call in the function
npl_freertos_callout_remaining_ticks() to enable fetching remaning ticks
when esp timer is enabled.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-12-03 15:51:14 +05:30
Jiang Jiang Jian 8b3eb74b16 Merge branch 'bugfix/dirty_timer_handle_after_deinit' into 'nimble-1.3.0-idf'
clear timer handle for struct ble_npl_callout during deinitializtion

See merge request espressif/esp-nimble!121
2021-11-22 03:07:34 +00:00
wangmengyang a4f3ace1e7 clear timer handle for struct ble_npl_callout during deinitializtion 2021-11-19 07:53:04 +08:00
Wang Meng Yang b94e9095a0 Merge branch 'bugfix/wifi_prov_mgr_crash' into 'nimble-1.3.0-idf'
NimBLE: Fixed wifi_prov_mgr crash after provisioning

See merge request espressif/esp-nimble!119
2021-11-18 11:42:05 +00:00
isha pardikar 3b5bff831c Merge branch 'wifi_prov_mgr_crash' into 'nimble-1.3.0-idf'
NimBLE: Fixed wifi_prov_mgr crash after provisioning

See merge request espressif/esp-nimble!119
2021-11-17 18:29:55 +05:30
Wang Meng Yang 7e0c82e5a6 Merge branch 'bugfix/add_warning_print_timer' into 'nimble-1.3.0-idf'
NimBLE: Modified timer not started / running warning print

See merge request espressif/esp-nimble!109
2021-11-15 07:47:38 +00:00
Rahul Tank 957ea59591 NimBLE: Modified timer not started / running warning print
Existing debug prints can misled user that a crash has happened. Updated the warning print of timer validity.
2021-11-10 12:33:08 +05:30
Wang Meng Yang e4f1862470 Merge branch 'bugfix/x_component_key_check' into 'nimble-1.3.0-idf'
NimBLE: Compare only x component of public key to avoid impersonation attack.

See merge request espressif/esp-nimble!106
2021-10-22 09:14:15 +00:00
Chinmay Chhajed c5be342b23 Compare only X component of public key to avoid impersonation attack. 2021-09-23 18:29:42 +05:30
Jiang Jiang Jian e21844be70 Merge branch 'bugfix/stack_init_check' into 'nimble-1.3.0-idf'
Nimble: Check stack initialization status before executing stack command

See merge request espressif/esp-nimble!102
2021-09-22 04:23:30 +00:00
Rahul Tank 6a06e0459e Nimble: Check stack status before executing stack command
Added change of checking stack status in the APIs exposed to user
2021-09-07 15:02:17 +05:30
Rahul Tank 94afe27117 Merge branch 'nimble/set_wl_packet_length' into 'nimble-1.3.0-idf'
NimBLE: Sync packet length API and whitelist API changes with upstream NimBLE

See merge request espressif/esp-nimble!98
2021-08-09 10:26:38 +00:00
Rahul Tank 4bffb99cff Merge branch 'bugfix/fix_macro_conversion' into 'nimble-1.3.0-idf'
Nimble: Fix logging level mismatch

See merge request espressif/esp-nimble!89
2021-07-27 13:15:59 +00:00
Rahul Tank 4e51509cf3 Nimble: Fix logging level mismatch
Added fix for two issues:
1. Fix C++ compilation issue due to automatic conversion between int and
esp_error_level_t
2. Use correct level macros to use system wide logging scheme
2021-07-23 14:22:52 +05:30
Prasad Alatkar f8b53fb319 NimBLE host: Make LE data length set API public
* Add public API `ble_gap_set_data_len` to set data length in controller.
2021-07-21 11:54:50 +05:30
Prasad Alatkar d1c75df860 NimBLE host: Modify ble_gap_wl_set to support clearing complete whitelist
* Modify test case `*_wl_bad_args` to accept 0 whitelist entries.
2021-07-21 11:52:44 +05:30
Rahul Tank 70e85e2f77 Merge branch 'bugfix/fix_crash_for_non_triggered_timer' into 'nimble-1.3.0-idf'
Nimble: Fix crash when attempting to delete a non-started timer

See merge request espressif/esp-nimble!90
2021-07-09 05:54:26 +00:00
Rahul Tank aef55bbf63 Nimble: Fix crash when attempting to do deinit
If esp timer is created, but not started, and if we call Nimble deinit , then during deinit, the existing code checks for the
timer state and returns with a status other than ESP_OK. However, existing ESP_ERROR_CHECK macro treats this as failure and causes crash.

Modified the code to use ESP_ERROR_CHECK_WITHOUT_ABORT instead.
2021-07-08 09:58:07 +05:30
Rahul Tank a90d8e46b8 Merge branch 'bugfix/add_esp_timer_support_for_nimble' into 'nimble-1.3.0-idf'
Nimble: commit for implementing esp_timer at npl layer

See merge request espressif/esp-nimble!84
2021-06-24 10:04:48 +00:00
Rahul Tank 8aa5131bd0 Implentation to use esp_timer instead of FreeRTOS timer at npl layer 2021-06-17 17:39:33 +05:30
Hrishikesh Dhayagude 5bb7b40227 Merge branch 'fix/ble_sm_sc_pub_key' into 'nimble-1.3.0-idf'
NimBLE: Fix MITM vulnerability in case of secure connection pairing (CVE-2020-26558)

See merge request espressif/esp-nimble!74
2021-05-13 10:08:59 +00:00
Jiang Jiang Jian d3153b1609 Merge branch 'nimble/fix_workaround_ble_conn_err' into 'nimble-1.3.0-idf'
NimBLE: Add workaround in host for BLE Connection establishment error.

See merge request espressif/esp-nimble!75
2021-05-13 09:55:02 +00:00
Prasad Alatkar c585ef5aca NimBLE: Add workaround in host for BLE Connection establishment error.
* Reattempt connection on link establishment error
2021-05-13 13:46:43 +05:30
Prasad Alatkar 9ab9468521 nimble/test: Add SC unit test to flag error on same public key 2021-05-06 20:29:03 +05:30
Prasad Alatkar 96603c68f5 nimble/host: Fix MITM vulnerability during public key exchange in secure connection 2021-05-06 20:28:46 +05:30
Hrishikesh Dhayagude f04c92400a Merge branch 'nimble/fix_broadcaster_role' into 'nimble-1.3.0-idf'
NimBLE: Add custom logging support and broadcaster role build failure fix

See merge request espressif/esp-nimble!72
2021-04-19 10:08:01 +00:00
Hrishikesh Dhayagude 04d00bc46f Merge branch 'nimble/fix_nvs_peer_dev_bug' into 'nimble-1.3.0-idf'
NimBLE NVS: Fix bug in deletion of peer_dev_record

See merge request espressif/esp-nimble!70
2021-04-19 10:04:59 +00:00
Prasad Alatkar f0ad8684b8 NimBLE: Add custom log level support
Closes https://github.com/espressif/esp-idf/issues/3585

Co-authored by: Switi Mhaiske <switi.mhaiske@espressif.com>
2021-04-19 14:57:38 +05:30
Krzysztof Kopyściński 7d956e2d3a nimble/ble_gap: adv_enable_tx preprocessor directives corrections
There wher compilation errors for blecent if NIMBLE_BLE_ADVERTISE was
not set. Appropriate preprocessor if conditions where added.
2021-04-09 21:28:17 +05:30
Prasad Alatkar 09ccbf3966 NimBLE NVS: Fix bug in deletion of peer_dev_record
- Fix comparison metric while deleting peer_dev_record. Previous to this,
  random address change after reboot used to result in NVS database mismatch
  and hence sometimes caused wrong NVS entry deletion.
- Closes ESPCS-540
2021-03-10 20:35:11 +05:30
Hrishikesh Dhayagude 1b808fcb80 Merge branch 'nimble/mbedtls_aes_free_dma' into 'nimble-1.3.0-idf'
NimBLE: Free the AES context after use by calling `mbetls_aes_free` (Needed for C3)

See merge request espressif/esp-nimble!64
2021-02-12 22:27:21 +08:00
Prasad Alatkar 5ffd5aa174 NimBLE: Free the AES context after use by calling mbetls_aes_free
* ESP32C3 allocates DMA channel when using HW AES accelerator.
* Deallocate the DMA channel properly i.e. call `mbedtls_aes_free` after using HW
  AES encryption.

Fixes BT-1435
2021-02-10 16:49:43 +05:30
Hrishikesh Dhayagude c6f69c1261 Merge branch 'nimble-1.3.0-C3-WL-DLE' into 'nimble-1.3.0-idf'
NimBLE: APIs to set whitelist and set LE packet length (nimble-1.3.0-idf)

See merge request espressif/esp-nimble!63
2021-01-20 14:04:18 +08:00
Prasad Alatkar a31aafb14c NimBLE host: Add API to remove address from whitelist 2021-01-20 11:19:03 +05:30
Prasad Alatkar 42a35aa2f4 NimBLE: Make LE data length set API public
- Helps to set LE data length in controller from host.
2021-01-20 11:11:14 +05:30
Prasad Alatkar 0563f7f094 NimBLE: Fix compilation errors when HOST_BASED_PRIVACY is disabled.
- When Host based privacy config option is disabled then automatically
  controller based privacy is enabled. Remove compilation errors for this case.
2020-12-29 10:21:20 +05:30
Chinmay Chhajed e75b6c2a64 NOTICE: Added modifications by espressif in LICENSE. 2020-12-07 14:32:35 +05:30