Bluedroid: Authentication fixes in Legacy and Secure Connection.

Prevent a remote device from doing a Bluetooth Impersonation Attack
(BIAS) by:

- Preventing remote device to downgrade secure connection
feature mask. Secure connection feature mask should remain same or
increase to enabled in link key generation and authentication.

- Doing a mutual authentication during Legacy Authentication.

Signed-off-by: Chinmay Chhajed <chinmay.chhajed@espressif.com>
This commit is contained in:
Chinmay Chhajed
2020-04-28 15:54:31 +05:30
parent 26272af3b4
commit e3350e7861
16 changed files with 271 additions and 50 deletions
@@ -792,13 +792,24 @@ void btm_vendor_specific_evt (UINT8 *p, UINT8 evt_len)
{
UINT8 i;
BTM_TRACE_DEBUG ("BTM Event: Vendor Specific event from controller");
#if (CLASSIC_BT_INCLUDED == TRUE)
UINT8 sub_event;
UINT8 *p_evt = p;
STREAM_TO_UINT8(sub_event, p_evt);
/* Check in subevent if authentication is through Legacy Authentication. */
if (sub_event == ESP_VS_REM_LEGACY_AUTH_CMP) {
UINT16 hci_handle;
STREAM_TO_UINT16(hci_handle, p_evt);
btm_sec_handle_remote_legacy_auth_cmp(hci_handle);
}
#endif /// (CLASSIC_BT_INCLUDED == TRUE)
for (i = 0; i < BTM_MAX_VSE_CALLBACKS; i++) {
if (btm_cb.devcb.p_vend_spec_cb[i]) {
(*btm_cb.devcb.p_vend_spec_cb[i])(evt_len, p);
}
}
BTM_TRACE_DEBUG ("BTM Event: Vendor Specific event from controller");
}