Bluetooth: SMP: Report failure only for authenticated pairing
If JustWorks pairing is used for pairing don't report failure. Change-Id: I23cee54a74dd021c1f273d987ca67066452d7801 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
765ad1f6b9
commit
84e9c1ec69
1 changed files with 6 additions and 4 deletions
|
@ -770,6 +770,7 @@ static void smp_reset(struct bt_conn *conn)
|
|||
static uint8_t smp_pairing_failed(struct bt_conn *conn, struct bt_buf *buf)
|
||||
{
|
||||
struct bt_smp_pairing_fail *req = (void *)buf->data;
|
||||
struct bt_smp *smp = conn->smp;
|
||||
|
||||
BT_ERR("reason 0x%x\n", req->reason);
|
||||
|
||||
|
@ -779,16 +780,17 @@ static uint8_t smp_pairing_failed(struct bt_conn *conn, struct bt_buf *buf)
|
|||
*/
|
||||
ARG_UNUSED(req);
|
||||
|
||||
smp_reset(conn);
|
||||
|
||||
switch (bt_smp_io_capa) {
|
||||
case BT_SMP_IO_DISPLAY_ONLY:
|
||||
switch (smp->method) {
|
||||
case PASSKEY_INPUT:
|
||||
case PASSKEY_DISPLAY:
|
||||
auth_cb->cancel(conn);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
smp_reset(conn);
|
||||
|
||||
/* return no error to avoid sending Pairing Failed in response */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue