|
|
@@ -1361,7 +1361,7 @@ tBTM_STATUS BTM_SetEncryption (BD_ADDR bd_addr, tBT_TRANSPORT transport, tBTM_SE
|
|
|
|
|
|
return (BTM_SUCCESS);
|
|
|
}
|
|
|
-
|
|
|
+ p_dev_rec->enc_init_by_we = TRUE;
|
|
|
/* enqueue security request if security is active */
|
|
|
if (p_dev_rec->p_callback || (p_dev_rec->sec_state != BTM_SEC_STATE_IDLE)) {
|
|
|
BTM_TRACE_WARNING ("Security Manager: BTM_SetEncryption busy, enqueue request\n");
|
|
|
@@ -4018,7 +4018,6 @@ void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable)
|
|
|
#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
|
|
|
tACL_CONN *p_acl = NULL;
|
|
|
UINT8 acl_idx = btm_handle_to_acl_index(handle);
|
|
|
- tGATT_TCB *p_tcb = NULL;
|
|
|
#endif
|
|
|
BTM_TRACE_EVENT ("Security Manager: encrypt_change status:%d State:%d, encr_enable = %d\n",
|
|
|
status, (p_dev_rec) ? p_dev_rec->sec_state : 0, encr_enable);
|
|
|
@@ -4046,14 +4045,6 @@ void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable)
|
|
|
p_dev_rec->sec_flags |= BTM_SEC_16_DIGIT_PIN_AUTHED;
|
|
|
}
|
|
|
} else {
|
|
|
-#if BLE_INCLUDED == TRUE
|
|
|
- /* Before the application layer has received the connection event, the device has received an
|
|
|
- encrypted request from the peer device. The device should wait until the application layer
|
|
|
- receives the connection event before updating 'sec_flags'. */
|
|
|
- if ((p_tcb = gatt_find_tcb_by_addr(p_dev_rec->ble.pseudo_addr, BT_TRANSPORT_LE)) == NULL) {
|
|
|
- //do nothing
|
|
|
- } else
|
|
|
-#endif
|
|
|
p_dev_rec->sec_flags |= (BTM_SEC_LE_AUTHENTICATED | BTM_SEC_LE_ENCRYPTED);
|
|
|
}
|
|
|
}
|
|
|
@@ -4543,7 +4534,7 @@ void btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
|
|
if (!p_dev_rec) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ p_dev_rec->enc_init_by_we = FALSE;
|
|
|
transport = (handle == p_dev_rec->hci_handle) ? BT_TRANSPORT_BR_EDR : BT_TRANSPORT_LE;
|
|
|
|
|
|
p_dev_rec->rs_disc_pending = BTM_SEC_RS_NOT_PENDING; /* reset flag */
|