hci: store ssp io capability request reply auth requirements in connection

This commit is contained in:
Matthias Ringwald 2024-10-23 14:59:53 +02:00
parent 042de22dd4
commit ca8a5d3cc1
2 changed files with 6 additions and 5 deletions

View File

@ -7332,9 +7332,9 @@ static bool hci_run_general_pending_commands(void){
// set authentication requirements:
// - MITM = ssp_authentication_requirement (USER) | requested_security_level (dynamic)
// - BONDING MODE: dedicated if requested, bondable otherwise. Drop bondable if not set for remote
uint8_t authreq = hci_stack->ssp_authentication_requirement & 1;
connection->io_cap_response_auth_req = hci_stack->ssp_authentication_requirement & 1;
if (gap_mitm_protection_required_for_security_level(connection->requested_security_level)){
authreq |= 1;
connection->io_cap_response_auth_req |= 1;
}
bool bonding = hci_stack->bondable;
if (connection->authentication_flags & AUTH_FLAG_RECV_IO_CAPABILITIES_RESPONSE){
@ -7347,9 +7347,9 @@ static bool hci_run_general_pending_commands(void){
}
if (bonding){
if (connection->bonding_flags & BONDING_DEDICATED){
authreq |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
connection->io_cap_response_auth_req |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
} else {
authreq |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
connection->io_cap_response_auth_req |= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING;
}
}
uint8_t have_oob_data = 0;
@ -7361,7 +7361,7 @@ static bool hci_run_general_pending_commands(void){
have_oob_data |= 2;
}
#endif
hci_send_cmd(&hci_io_capability_request_reply, &connection->address, hci_stack->ssp_io_capability, have_oob_data, authreq);
hci_send_cmd(&hci_io_capability_request_reply, &connection->address, hci_stack->ssp_io_capability, have_oob_data, connection->io_cap_response_auth_req);
return true;
}

View File

@ -582,6 +582,7 @@ typedef struct {
uint8_t remote_supported_features[1];
// IO Capabilities Response
uint8_t io_cap_request_auth_req;
uint8_t io_cap_response_auth_req;
uint8_t io_cap_response_io;
#ifdef ENABLE_CLASSIC_PAIRING_OOB