component/bt: Added the sec_act != BTM_BLE_SEC_ENCRYPT check in the btm_ble_set_encryption function when the sec_act is BTM_BLE_SEC_ENCRYPT_NO_MITM or BTM_BLE_SEC_ENCRYPT_MITM.

This commit is contained in:
yulong 2017-10-23 15:01:00 +08:00
parent da32fbce7a
commit a9a423a025

View File

@ -1422,7 +1422,7 @@ tBTM_STATUS btm_ble_set_encryption (BD_ADDR bd_addr, void *p_ref_data, UINT8 lin
sec_request to request the master to encrypt the link */
case BTM_BLE_SEC_ENCRYPT_NO_MITM:
case BTM_BLE_SEC_ENCRYPT_MITM:
if (link_role == BTM_ROLE_MASTER) {
if ((link_role == BTM_ROLE_MASTER) && (sec_act != BTM_BLE_SEC_ENCRYPT)) {
auth_req = (sec_act == BTM_BLE_SEC_ENCRYPT_NO_MITM)
? SMP_AUTH_GEN_BOND : (SMP_AUTH_GEN_BOND | SMP_AUTH_YN_BIT);
btm_ble_link_sec_check (bd_addr, auth_req, &sec_req_act);