mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/BLE_SM_Security_Flags_pr1320' into 'master'
bt: Fix ble sm security flags (Github PR 1320) See merge request !1740
This commit is contained in:
commit
f9ad17eee4
@ -492,7 +492,7 @@ void bta_dm_co_ble_set_rsp_key_req(UINT8 rsp_key)
|
|||||||
{
|
{
|
||||||
#if (SMP_INCLUDED == TRUE)
|
#if (SMP_INCLUDED == TRUE)
|
||||||
rsp_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
|
rsp_key &= 0x0f; // 4~7bit reservd, only used the 0~3bit
|
||||||
bte_appl_cfg.ble_init_key &= rsp_key;
|
bte_appl_cfg.ble_resp_key &= rsp_key;
|
||||||
#endif ///SMP_INCLUDED == TRUE
|
#endif ///SMP_INCLUDED == TRUE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1221,6 +1221,14 @@ void btm_sec_save_le_key(BD_ADDR bd_addr, tBTM_LE_KEY_TYPE key_type, tBTM_LE_KEY
|
|||||||
p_rec->ble.keys.key_size = p_keys->lenc_key.key_size;
|
p_rec->ble.keys.key_size = p_keys->lenc_key.key_size;
|
||||||
p_rec->ble.key_type |= BTM_LE_KEY_LENC;
|
p_rec->ble.key_type |= BTM_LE_KEY_LENC;
|
||||||
|
|
||||||
|
/* Set that link key is known since this shares field with BTM_SEC_FLAG_LKEY_KNOWN flag in btm_api.h*/
|
||||||
|
p_rec->sec_flags |= BTM_SEC_LE_LINK_KEY_KNOWN;
|
||||||
|
if ( p_keys->pcsrk_key.sec_level == SMP_SEC_AUTHENTICATED) {
|
||||||
|
p_rec->sec_flags |= BTM_SEC_LE_LINK_KEY_AUTHED;
|
||||||
|
} else {
|
||||||
|
p_rec->sec_flags &= ~BTM_SEC_LE_LINK_KEY_AUTHED;
|
||||||
|
}
|
||||||
|
|
||||||
BTM_TRACE_DEBUG("BTM_LE_KEY_LENC key_type=0x%x DIV=0x%x key_size=0x%x sec_level=0x%x",
|
BTM_TRACE_DEBUG("BTM_LE_KEY_LENC key_type=0x%x DIV=0x%x key_size=0x%x sec_level=0x%x",
|
||||||
p_rec->ble.key_type,
|
p_rec->ble.key_type,
|
||||||
p_rec->ble.keys.div,
|
p_rec->ble.keys.div,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user