Bluetooth: BR/EDR: Notify about pairing while JustWorks

In some cases 'justworks' model applied on authentication/pairing process
requires user attention.
BT Core 4.2 says in table 5.7 [Vol 3, Part C, 5.2.2.6] that not always
passkey auto-accept can be applied on both devices involved in SSP
pairing for this authentication association model.

Change-Id: I7cc575ac088bcce7830f22d08e49dab40889f515
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
Arkadiusz Lichwa 2016-03-22 12:52:49 +01:00 committed by Johan Hedberg
commit 99483fded6

View file

@ -448,8 +448,14 @@ void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey)
bt_auth->passkey_entry(conn);
break;
case JUST_WORKS:
/* TODO do this only for incoming pairing */
if (bt_auth && bt_auth->pairing_confirm) {
/*
* When local host works as pairing acceptor and 'justworks'
* model is applied then notify user about such pairing request.
* [BT Core 4.2 table 5.7, Vol 3, Part C, 5.2.2.6]
*/
if (bt_auth && bt_auth->pairing_confirm &&
!atomic_test_bit(conn->flags,
BT_CONN_BR_PAIRING_INITIATOR)) {
atomic_set_bit(conn->flags, BT_CONN_USER);
bt_auth->pairing_confirm(conn);
break;