From 8bc12d19055f3fcab93ac6a91eaa88de41ad29ef Mon Sep 17 00:00:00 2001 From: Magdalena Kasenberg Date: Mon, 15 Jun 2026 18:35:07 +0200 Subject: [PATCH] nimble/host: Fix rejected SM SC debug keys --- nimble/host/src/ble_sm_sc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nimble/host/src/ble_sm_sc.c b/nimble/host/src/ble_sm_sc.c index fdb5f8e537..256f03f28b 100644 --- a/nimble/host/src/ble_sm_sc.c +++ b/nimble/host/src/ble_sm_sc.c @@ -612,6 +612,7 @@ ble_sm_sc_public_key_rx(uint16_t conn_handle, struct os_mbuf **om, } cmd = (struct ble_sm_public_key *)(*om)->om_data; +#if !MYNEWT_VAL(BLE_SM_SC_DEBUG_KEYS) /* Check if the peer public key is same as our generated public key. * Return fail if the public keys match. */ if (memcmp(cmd, ble_sm_sc_pub_key, 64) == 0) { @@ -619,6 +620,7 @@ ble_sm_sc_public_key_rx(uint16_t conn_handle, struct os_mbuf **om, res->sm_err = BLE_SM_ERR_AUTHREQ; return; } +#endif ble_hs_lock(); proc = ble_sm_proc_find(conn_handle, BLE_SM_PROC_STATE_PUBLIC_KEY, -1,