From b0e723fa37ea43534261c7dc6b696cb3a405f0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Thu, 13 Jun 2019 07:10:14 +0200 Subject: [PATCH] nimble/sm: Fix rejecting stronger bond If there exists an authenticated bond and the slave sends a security request with No MITM we should not try to pair again as the stored bond is stronger than the requested one. --- nimble/host/src/ble_sm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c index 3601bcae2..4ef5b76d3 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -1961,9 +1961,7 @@ ble_sm_sec_req_rx(uint16_t conn_handle, struct os_mbuf **om, * requested minimum authreq. */ authreq_mitm = cmd->authreq & BLE_SM_PAIR_AUTHREQ_MITM; - if ((!authreq_mitm && value_sec.authenticated) || - (authreq_mitm && !value_sec.authenticated)) { - + if (authreq_mitm && !value_sec.authenticated) { res->app_status = BLE_HS_EREJECT; } }