mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 10:13:29 +00:00
gap: calculate IO Cap AuthReq Bondable Mode based on gap_ssp_set_authentication_requirement and gap_set_bondable_mode
This commit is contained in:
parent
6058cb0da7
commit
a8d20135f0
@ -58,6 +58,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
|
||||
|
||||
|
14
src/hci.c
14
src/hci.c
@ -4322,14 +4322,18 @@ static bool hci_run_general_pending_commands(void){
|
||||
|
||||
if (connection->authentication_flags & SEND_IO_CAPABILITIES_REPLY){
|
||||
connectionClearAuthenticationFlags(connection, SEND_IO_CAPABILITIES_REPLY);
|
||||
// tweak authentication requirements
|
||||
uint8_t authreq = hci_stack->ssp_authentication_requirement;
|
||||
if (connection->bonding_flags & BONDING_DEDICATED){
|
||||
authreq = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
|
||||
}
|
||||
// set authentication requirements:
|
||||
// - MITM = ssp_authentication_requirement (USER) | requested_security_level (dynamic)
|
||||
// - BONDING MODE: Dedicated if requested, otherwise bondable flag
|
||||
uint8_t authreq = hci_stack->ssp_authentication_requirement & 1;
|
||||
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
|
||||
authreq |= 1;
|
||||
}
|
||||
if (connection->bonding_flags & BONDING_DEDICATED){
|
||||
authreq |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
|
||||
} else if (hci_stack->bondable){
|
||||
authreq |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
|
||||
}
|
||||
uint8_t have_oob_data = 0;
|
||||
#ifdef ENABLE_CLASSIC_PAIRING_OOB
|
||||
if (connection->classic_oob_c_192 != NULL){
|
||||
|
Loading…
x
Reference in New Issue
Block a user