You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2024/09/02 19:41:06 UTC
(mynewt-nimble) 01/03: host: sm: ignore security request
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 22d5e0e042cacce4e6bd7f4a1463637c307bed96
Author: Piotr Narajowski <pi...@codecoup.pl>
AuthorDate: Thu Aug 1 16:47:03 2024 +0200
host: sm: ignore security request
We should ignore second security request pairing has already started
---
nimble/host/src/ble_sm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c
index bb1dfe084..eed5e3638 100644
--- a/nimble/host/src/ble_sm.c
+++ b/nimble/host/src/ble_sm.c
@@ -2007,6 +2007,14 @@ ble_sm_sec_req_rx(uint16_t conn_handle, struct os_mbuf **om,
ble_hs_lock();
conn = ble_hs_conn_find_assert(conn_handle);
+
+ /* Check if pairing procedure is already in progress */
+ if (ble_sm_proc_find(conn_handle, BLE_SM_PROC_STATE_PAIR, 1, NULL)) {
+ ble_hs_unlock();
+ res->app_status = 0;
+ return;
+ }
+
if (!(conn->bhc_flags & BLE_HS_CONN_F_MASTER)) {
res->app_status = BLE_HS_SM_US_ERR(BLE_SM_ERR_CMD_NOT_SUPP);
res->sm_err = BLE_SM_ERR_CMD_NOT_SUPP;