mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 00:40:04 +00:00
l2cap: send ecbm pending if authentication possible
This commit is contained in:
parent
8edd6a0adf
commit
436d089a6a
18
src/l2cap.c
18
src/l2cap.c
@ -3929,10 +3929,18 @@ static int l2cap_ecbm_signaling_handler_dispatch(hci_con_handle_t handle, uint16
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security_status != L2CAP_ECBM_CONNECTION_RESULT_ALL_SUCCESS){
|
// check if authentication is possible
|
||||||
l2cap_register_signaling_response(handle, L2CAP_CREDIT_BASED_CONNECTION_REQUEST, sig_id,
|
bool send_pending = false;
|
||||||
num_channels_and_signaling_cid, security_status);
|
if (security_status != L2CAP_ECBM_CONNECTION_RESULT_ALL_SUCCESS) {
|
||||||
return 1;
|
if (gap_get_bondable_mode() != 0) {
|
||||||
|
// if possible, send pending and continue
|
||||||
|
send_pending = true;
|
||||||
|
} else {
|
||||||
|
// otherwise, send refused and abort
|
||||||
|
l2cap_register_signaling_response(handle, L2CAP_CREDIT_BASED_CONNECTION_REQUEST, sig_id,
|
||||||
|
num_channels_and_signaling_cid, L2CAP_ECBM_CONNECTION_RESULT_ALL_PENDING_AUTHENTICATION);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// report the last result code != 0
|
// report the last result code != 0
|
||||||
@ -4008,7 +4016,7 @@ static int l2cap_ecbm_signaling_handler_dispatch(hci_con_handle_t handle, uint16
|
|||||||
// if security is pending, send intermediate response, otherwise, ask user
|
// if security is pending, send intermediate response, otherwise, ask user
|
||||||
if (send_pending){
|
if (send_pending){
|
||||||
l2cap_register_signaling_response(handle, L2CAP_CREDIT_BASED_CONNECTION_REQUEST, sig_id,
|
l2cap_register_signaling_response(handle, L2CAP_CREDIT_BASED_CONNECTION_REQUEST, sig_id,
|
||||||
num_channels_and_signaling_cid, security_status);
|
num_channels_and_signaling_cid, L2CAP_ECBM_CONNECTION_RESULT_ALL_PENDING_AUTHENTICATION);
|
||||||
} else {
|
} else {
|
||||||
l2cap_ecbm_handle_security_level_incoming_sufficient(a_channel);
|
l2cap_ecbm_handle_security_level_incoming_sufficient(a_channel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user