From 91c01fbab71b44de2471d28d8bd45e4676f55141 Mon Sep 17 00:00:00 2001 From: Pragati Date: Wed, 3 Jul 2024 10:58:42 +0530 Subject: Reject SMP pairing SMP_BUSY error while host is in pairing with another device Steps to reproduce: |- 1. Turn on BT 2. Iniatited LE SMP pairing with remote 1 3. Initiate pairing from remote2 to DUT Expected result: DUT should reject the SMP pairing req from remote2 with SMP_BUSY error - Observed result: NA. its new feature from bluetooth specification 6.0 Fix: Reject SMP pairing SMP_BUSY error while host is in pairing with another device Test: atest automated-test bug: 381996349 Flag: EXEMPT bugfix Change-Id: I3f07864a9258bc8457e4d5e3f37e4ca717f42aa0 --- system/stack/smp/smp_api.cc | 4 ++-- system/stack/smp/smp_utils.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'system/stack/smp') diff --git a/system/stack/smp/smp_api.cc b/system/stack/smp/smp_api.cc index 4485bf3fcb..98cf3d42e9 100644 --- a/system/stack/smp/smp_api.cc +++ b/system/stack/smp/smp_api.cc @@ -89,7 +89,7 @@ tSMP_STATUS SMP_Pair(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type) { if (p_cb->state != SMP_STATE_IDLE || p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD || p_cb->smp_over_br) { /* pending security on going, reject this one */ - return SMP_BUSY; + return SMP_IMPL_BUSY; } else { p_cb->flags = SMP_PAIR_FLAGS_WE_STARTED_DD; p_cb->pairing_bda = bd_addr; @@ -135,7 +135,7 @@ tSMP_STATUS SMP_BR_PairWith(const RawAddress& bd_addr) { if (p_cb->state != SMP_STATE_IDLE || p_cb->smp_over_br || p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD) { /* pending security on going, reject this one */ - return SMP_BUSY; + return SMP_IMPL_BUSY; } p_cb->role = HCI_ROLE_CENTRAL; diff --git a/system/stack/smp/smp_utils.cc b/system/stack/smp/smp_utils.cc index 2c4f43746b..97a10da442 100644 --- a/system/stack/smp/smp_utils.cc +++ b/system/stack/smp/smp_utils.cc @@ -1231,7 +1231,7 @@ void smp_reject_unexpected_pairing_command(const RawAddress& bd_addr) { p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; UINT8_TO_STREAM(p, SMP_OPCODE_PAIRING_FAILED); - UINT8_TO_STREAM(p, SMP_PAIR_NOT_SUPPORT); + UINT8_TO_STREAM(p, SMP_BUSY); p_buf->offset = L2CAP_MIN_OFFSET; p_buf->len = SMP_PAIR_FAIL_SIZE; -- cgit v1.2.3-59-g8ed1b