Merge branch 'bugfix/fix_ble_security_param_v5.2' into 'release/v5.2'

fix(ble/bluedroid): Fixed issue with resetting BLE security parameters during initialization (v5.2)

See merge request espressif/esp-idf!32506
This commit is contained in:
Island 2024-08-02 17:38:32 +08:00
commit c2ac357c7a
3 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,18 @@ tBTE_APPL_CFG bte_appl_cfg = {
BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE, BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE,
BTM_BLE_OOB_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 #endif
#if (defined CLASSIC_BT_INCLUDED && CLASSIC_BT_INCLUDED == TRUE) #if (defined CLASSIC_BT_INCLUDED && CLASSIC_BT_INCLUDED == TRUE)

View File

@ -1779,6 +1779,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_broadcast (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_data_length(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); 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 #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
extern void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data); 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); extern void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data);

View File

@ -60,6 +60,7 @@ static void btc_init_bluetooth(void)
#if (BLE_INCLUDED == TRUE) #if (BLE_INCLUDED == TRUE)
//load the ble local key which has been stored in the flash //load the ble local key which has been stored in the flash
btc_dm_load_ble_local_keys(); btc_dm_load_ble_local_keys();
bta_dm_co_security_param_init();
#endif ///BLE_INCLUDED == TRUE #endif ///BLE_INCLUDED == TRUE
#endif /* #if (SMP_INCLUDED) */ #endif /* #if (SMP_INCLUDED) */
#if BTA_DYNAMIC_MEMORY #if BTA_DYNAMIC_MEMORY