Skip to content

Conversation

@HaavardRei
Copy link
Contributor

@HaavardRei HaavardRei commented Nov 20, 2025

Adds the CONFIG_BT_SMP_LEGACY_PAIR_ONLY Kconfig option to force devices to use legacy pairing. This has a dependency on CONFIG_BT_TESTING as it is only intended for testing purposes, and use of legacy pairing is discouraged.

jhedberg
jhedberg previously approved these changes Nov 20, 2025

config BT_SMP_ENFORCE_LEGACY_PAIRING
bool "Enforce legacy pairing"
depends on BT_TESTING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not allowed to only support legacy pairing in recent version of the core spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's allowed, but since Zephyr 3.0 the use of legacy pairing has been discouraged for being less/not secure, so I didn't want this Kconfig to imply otherwise. Zephyr-devices support legacy pairing with devices that do not support secure connections, but since Zephyr-devices do support it they will always default to this (and thus this config is needed to force it).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should allow setting this without BT_TESTING, but treat it as a warning for the above reasons. That would be similar to how we treat e.g. BT_USE_DEBUG_KEYS, where we have both Kconfig and CMake warnings if it's enabled.

Alternatively we should consider adding the same depends on BT_TESTING for things like BT_USE_DEBUG_KEYS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both suggestions are fine by me, do you have any thoughts @jhedberg?

Adds the `CONFIG_BT_SMP_LEGACY_PAIR_ONLY` Kconfig option to force
devices to use legacy pairing. This has a dependency on
`CONFIG_BT_TESTING` as it is only intended for testing purposes, and use
of legacy pairing is discouraged.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants