Merge branch 'bugfix/btdm_smp_invalid_key_size' into 'master'

component/bt: Change the SMP key size analyzing conditions.

See merge request !958
This commit is contained in:
Jiang Jiang Jian 2017-08-21 19:38:15 +08:00
commit 5c9d9ae696
2 changed files with 2 additions and 2 deletions

View file

@ -403,7 +403,6 @@ void bta_dm_co_ble_load_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK *p_key_mask, BT_OC
#endif ///defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE
#if (SMP_INCLUDED == TRUE)
btc_dm_get_ble_local_keys( p_key_mask, er, p_id_keys);
BTIF_TRACE_DEBUG("bta_dm_co_ble_load_local_keys: func not ported\n");
#endif ///SMP_INCLUDED == TRUE
}
@ -502,7 +501,7 @@ void bta_dm_co_ble_set_rsp_key_req(UINT8 rsp_key)
void bta_dm_co_ble_set_max_key_size(UINT8 ble_key_size)
{
#if (SMP_INCLUDED == TRUE)
if(ble_key_size > 7 && ble_key_size >= 16) {
if(ble_key_size >= BTM_BLE_MIN_KEY_SIZE && ble_key_size <= BTM_BLE_MAX_KEY_SIZE) {
bte_appl_cfg.ble_max_key_size = ble_key_size;
} else {
APPL_TRACE_ERROR("%s error:Invalid key size value, key_size =%d",__func__, ble_key_size);

View file

@ -1416,6 +1416,7 @@ typedef UINT8 tBTM_IO_CAP;
#define BTM_BLE_INITIATOR_KEY_SIZE 15
#define BTM_BLE_RESPONDER_KEY_SIZE 15
#define BTM_BLE_MAX_KEY_SIZE 16
#define BTM_BLE_MIN_KEY_SIZE 7
typedef UINT8 tBTM_AUTH_REQ;