File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1163,6 +1163,15 @@ config BT_CONN_DISABLE_SECURITY
11631163 WARNING: This option enables anyone to snoop on-air traffic.
11641164 Use of this feature in production is strongly discouraged.
11651165
1166+ config BT_SMP_ENFORCE_LEGACY_PAIRING
1167+ bool "Enforce legacy pairing"
1168+ depends on BT_TESTING
1169+ depends on !(BT_SMP_SC_PAIR_ONLY || BT_SMP_SC_ONLY)
1170+ help
1171+ This option enforces legacy pairing. This is required for testing
1172+ legacy pairing between two Zephyr Bluetooth devices, as without this
1173+ option the devices will default to using Secure Connections pairing.
1174+
11661175rsource "./classic/Kconfig"
11671176
11681177config BT_HCI_VS_EVT_USER
Original file line number Diff line number Diff line change @@ -93,21 +93,21 @@ LOG_MODULE_REGISTER(bt_smp);
9393#if defined(CONFIG_BT_CLASSIC )
9494
9595#define BT_SMP_AUTH_MASK_SC 0x2f
96- #if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
96+ #if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY ) || defined( CONFIG_BT_SMP_ENFORCE_LEGACY_PAIRING )
9797#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2)
9898#else
9999#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_CT2 |\
100100 BT_SMP_AUTH_SC)
101- #endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */
101+ #endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_ENFORCE_LEGACY_PAIRING */
102102
103103#else
104104
105105#define BT_SMP_AUTH_MASK_SC 0x0f
106- #if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )
106+ #if defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY ) || defined( CONFIG_BT_SMP_ENFORCE_LEGACY_PAIRING )
107107#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS)
108108#else
109109#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_SC)
110- #endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */
110+ #endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY || CONFIG_BT_SMP_ENFORCE_LEGACY_PAIRING */
111111
112112#endif /* CONFIG_BT_CLASSIC */
113113
@@ -322,7 +322,8 @@ static struct {
322322
323323static bool le_sc_supported (void )
324324{
325- if (IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY )) {
325+ if (IS_ENABLED (CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY ) ||
326+ IS_ENABLED (CONFIG_BT_SMP_ENFORCE_LEGACY_PAIRING )) {
326327 return false;
327328 }
328329
You can’t perform that action at this time.
0 commit comments