mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-03 07:13:51 +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
|
events instead of callback, and `RFCOMM_DATA_PACKET` for received data
|
||||||
HSP AG: emit HSP_SUBEVENT_BUTTON_PRESSED instead of audio connection setup/release
|
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
|
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
|
## 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){
|
if (connection->authentication_flags & SEND_IO_CAPABILITIES_REPLY){
|
||||||
connectionClearAuthenticationFlags(connection, SEND_IO_CAPABILITIES_REPLY);
|
connectionClearAuthenticationFlags(connection, SEND_IO_CAPABILITIES_REPLY);
|
||||||
// tweak authentication requirements
|
// set authentication requirements:
|
||||||
uint8_t authreq = hci_stack->ssp_authentication_requirement;
|
// - MITM = ssp_authentication_requirement (USER) | requested_security_level (dynamic)
|
||||||
if (connection->bonding_flags & BONDING_DEDICATED){
|
// - BONDING MODE: Dedicated if requested, otherwise bondable flag
|
||||||
authreq = SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
|
uint8_t authreq = hci_stack->ssp_authentication_requirement & 1;
|
||||||
}
|
|
||||||
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
|
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
|
||||||
authreq |= 1;
|
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;
|
uint8_t have_oob_data = 0;
|
||||||
#ifdef ENABLE_CLASSIC_PAIRING_OOB
|
#ifdef ENABLE_CLASSIC_PAIRING_OOB
|
||||||
if (connection->classic_oob_c_192 != NULL){
|
if (connection->classic_oob_c_192 != NULL){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user