From c3911c48178dd2ed2a4fc95effaac369e9bd68d0 Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Wed, 4 Sep 2024 22:59:13 +0800 Subject: [PATCH] feat(nimble): Added option in menuconfig to enable Secure Connections Only mode --- components/bt/host/nimble/Kconfig.in | 7 +++++++ components/bt/host/nimble/port/include/esp_nimble_cfg.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index bc2a146acf..5e29038f2e 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -230,6 +230,13 @@ config BT_NIMBLE_SM_LVL 3. Authenticated pairing with encryption 4. Authenticated LE Secure Connections pairing with encryption using a 128-bit strength encryption key. +config BT_NIMBLE_SM_SC_ONLY + int "Enable Secure Connections Only Mode" + depends on BT_NIMBLE_SECURITY_ENABLE + default 0 + help + Enable Secure Connections Only Mode + config BT_NIMBLE_DEBUG bool "Enable extra runtime asserts and host debugging" default n diff --git a/components/bt/host/nimble/port/include/esp_nimble_cfg.h b/components/bt/host/nimble/port/include/esp_nimble_cfg.h index 836f54a8ae..ce9b28a7fd 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -961,8 +961,12 @@ #endif #ifndef MYNEWT_VAL_BLE_SM_SC_ONLY +#ifdef CONFIG_BT_NIMBLE_SM_SC_ONLY +#define MYNEWT_VAL_BLE_SM_SC_ONLY CONFIG_BT_NIMBLE_SM_SC_ONLY +#else #define MYNEWT_VAL_BLE_SM_SC_ONLY (0) #endif +#endif #ifndef MYNEWT_VAL_BLE_SM_THEIR_KEY_DIST #define MYNEWT_VAL_BLE_SM_THEIR_KEY_DIST (0)