gap: only store link key for ssp if remote side has set bondable in io cap auth requirements as well

This commit is contained in:
Matthias Ringwald 2021-03-25 10:19:14 +01:00
parent 50d7398c74
commit bec5f683aa
2 changed files with 14 additions and 3 deletions

View File

@ -31,7 +31,9 @@ A2DP Source: `ENABLE_A2DP_SOURCE_EXPLICIT_CONFIG` disables auto config. Requires
### Fixed
HCI: handle start inquiry failure
AVRCP Target: fix notification changed event
HFP: Emit Audio Connection Released on SLC Release, e.g. remote power off
HFP: Emit Audio Connection Released on SLC Release, e.g. remote power off
GAP: calculate IO Cap AuthReq Bondable Mode based on `gap_ssp_set_authentication_requirement` and `gap_set_bondable_mode`
GAP: only store link key for ssp if remote side has set bondable in io cap auth requirements as well
### Changed
HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`, reduce bit clock to 256/512 kHz
@ -58,8 +60,7 @@ u-blox SPP Service Server: use `GATTSERVICE_SUBEVENT_SPP_SERVICE_CONNECTED` and
events instead of callback, and `RFCOMM_DATA_PACKET` for received data
HSP AG: emit HSP_SUBEVENT_BUTTON_PRESSED instead of audio connection setup/release
Examples: use `btstack_event.h` getters instead of direct array access, use enum to compare status codes
GAP: calculate IO Cap AuthReq Bondable Mode based on `gap_ssp_set_authentication_requirement` and `gap_set_bondable_mode`
## Release v1.3.2
### Added

View File

@ -2618,6 +2618,16 @@ static void event_handler(uint8_t *packet, uint16_t size){
if (link_key_type != CHANGED_COMBINATION_KEY){
conn->link_key_type = link_key_type;
}
// only store link key:
// - if bondable enabled
if (hci_stack->bondable == false) break;
// - for SSP, also check if remote side requested bonding as well
if (conn->link_key_type != COMBINATION_KEY){
uint8_t auth_req_ignoring_mitm = conn->io_cap_response_auth_req & 0xfe;
if (auth_req_ignoring_mitm == SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_NO_BONDING){
break;
}
}
gap_store_link_key_for_bd_addr(addr, &packet[8], conn->link_key_type);
// still forward event to allow dismiss of pairing dialog
break;