Bluetooth: BR/EDR: Set user mode flag on User Confirmation event
During handling User Confirmation request, set user flag to allow stack handle interaction with user authentication callback mechanism. Change-Id: I7779e3dd8e5cee4caf9f182f02c7409bb5bb8c61 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
029820c926
commit
cac53e057f
1 changed files with 6 additions and 0 deletions
|
@ -874,6 +874,7 @@ void bt_conn_ssp_auth(struct bt_conn *conn, uint32_t passkey)
|
|||
/* Start interactive authentication if valid, default to justworks. */
|
||||
switch (conn->br.ssp_method) {
|
||||
case PASSKEY_CONFIRM:
|
||||
atomic_set_bit(conn->flags, BT_CONN_USER);
|
||||
bt_auth->passkey_confirm(conn, passkey);
|
||||
break;
|
||||
default:
|
||||
|
@ -1411,6 +1412,11 @@ int bt_conn_auth_passkey_confirm(struct bt_conn *conn)
|
|||
#endif /* CONFIG_BLUETOOTH_SMP */
|
||||
#if defined(CONFIG_BLUETOOTH_BREDR)
|
||||
if (conn->type == BT_CONN_TYPE_BR) {
|
||||
/* Allow user confirm passkey value, then reset user state. */
|
||||
if (!atomic_test_and_clear_bit(conn->flags, BT_CONN_USER)) {
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
return ssp_confirm_reply(conn);
|
||||
}
|
||||
#endif /* CONFIG_BLUETOOTH_BREDR */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue