Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_ble_security_param_v5.3' into 'release/v5.3'
Browse files Browse the repository at this point in the history
fix(ble/bluedroid): Fixed issue with resetting BLE security parameters during initialization (v5.3)

See merge request espressif/esp-idf!32505
  • Loading branch information
Isl2017 committed Aug 2, 2024
2 parents 530f10f + 1df847e commit 883ee8b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/bt/host/bluedroid/bta/dm/bta_dm_co.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ tBTE_APPL_CFG bte_appl_cfg = {
BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE,
BTM_BLE_OOB_DISABLE,
};

void bta_dm_co_security_param_init(void)
{
bte_appl_cfg.ble_auth_req = BTA_LE_AUTH_REQ_SC_MITM_BOND;
bte_appl_cfg.ble_io_cap = BTM_LOCAL_IO_CAPS_BLE;
bte_appl_cfg.ble_init_key = BTM_BLE_INITIATOR_KEY_SIZE;
bte_appl_cfg.ble_resp_key = BTM_BLE_RESPONDER_KEY_SIZE;
bte_appl_cfg.ble_max_key_size = BTM_BLE_MAX_KEY_SIZE;
bte_appl_cfg.ble_min_key_size = BTM_BLE_MIN_KEY_SIZE;
bte_appl_cfg.ble_accept_auth_enable = BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE;
bte_appl_cfg.oob_support = BTM_BLE_OOB_DISABLE;
};
#endif

#if (defined CLASSIC_BT_INCLUDED && CLASSIC_BT_INCLUDED == TRUE)
Expand Down
3 changes: 3 additions & 0 deletions components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,9 @@ extern void bta_dm_ble_set_scan_rsp_raw (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_update_duplicate_exceptional_list(tBTA_DM_MSG *p_data);
#if SMP_INCLUDED == TRUE
extern void bta_dm_co_security_param_init(void);
#endif
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
extern void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data);
extern void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data);
Expand Down
1 change: 1 addition & 0 deletions components/bt/host/bluedroid/btc/core/btc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static void btc_init_bluetooth(void)
#if (BLE_INCLUDED == TRUE)
//load the ble local key which has been stored in the flash
btc_dm_load_ble_local_keys();
bta_dm_co_security_param_init();
#endif ///BLE_INCLUDED == TRUE
#endif /* #if (SMP_INCLUDED) */
#if BTA_DYNAMIC_MEMORY
Expand Down

0 comments on commit 883ee8b

Please sign in to comment.