Skip to content

Commit b40de2b

Browse files
HaavardReirlubos
authored andcommitted
[nrf fromtree] Bluetooth: Host: Deprecate BT_FIXED_PASSKEY
The BT_FIXED_PASSKEY Kconfig option is being deprecated, and is replaced by BT_APP_PASSKEY. The reason for the deprecation is an upcoming errata, ES-24489, which mandates that a new passkey shall be generated for each pairing procedure. Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no> (cherry picked from commit 82cfb5a) Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
1 parent b225a5b commit b40de2b

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

doc/releases/migration-guide-4.3.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ Bluetooth HCI
123123
* The deprecated ``ipm`` value was removed from ``bt-hci-bus`` devicetree property.
124124
``ipc`` should be used instead.
125125

126+
Bluetooth Host
127+
==============
128+
129+
* :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` has been deprecated. Instead, the application can
130+
provide passkeys for pairing using the :c:member:`bt_conn_auth_cb.app_passkey` callback, which is
131+
available when :kconfig:option:`CONFIG_BT_APP_PASSKEY` is enabled. The application can return the
132+
passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` for the Host to generate a random passkey
133+
instead.
134+
126135
Ethernet
127136
========
128137

include/zephyr/bluetooth/conn.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,8 +2380,8 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn,
23802380
const struct bt_le_oob_sc_data **oobd_remote);
23812381

23822382
/**
2383-
* Special passkey value that can be used to disable a previously
2384-
* set fixed passkey.
2383+
* DEPRECATED - use @ref BT_PASSKEY_RAND instead. Special passkey value that can be used to disable
2384+
* a previously set fixed passkey.
23852385
*/
23862386
#define BT_PASSKEY_INVALID 0xffffffff
23872387

@@ -2393,12 +2393,15 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn,
23932393
* Sets a fixed passkey to be used for pairing. If set, the
23942394
* pairing_confirm() callback will be called for all incoming pairings.
23952395
*
2396+
* @deprecated Use @ref BT_PASSKEY_RAND and the app_passkey callback from @ref bt_conn_auth_cb
2397+
* instead.
2398+
*
23962399
* @param passkey A valid passkey (0 - 999999) or BT_PASSKEY_INVALID
23972400
* to disable a previously set fixed passkey.
23982401
*
23992402
* @return 0 on success or a negative error code on failure.
24002403
*/
2401-
int bt_passkey_set(unsigned int passkey);
2404+
__deprecated int bt_passkey_set(unsigned int passkey);
24022405

24032406
/** Info Structure for OOB pairing */
24042407
struct bt_conn_oob_info {

subsys/bluetooth/host/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,10 @@ config BT_SMP_USB_HCI_CTLR_WORKAROUND
701701
if the keys are distributed over an encrypted link.
702702

703703
config BT_FIXED_PASSKEY
704-
bool "Use a fixed passkey for pairing"
704+
bool "Use a fixed passkey for pairing [DEPRECATED]"
705+
select DEPRECATED
705706
help
707+
This option is deprecated, use BT_APP_PASSKEY instead.
706708
With this option enabled, the application will be able to call the
707709
bt_passkey_set() API to set a fixed passkey. If set, the
708710
pairing_confirm() callback will be called for all incoming pairings.

0 commit comments

Comments
 (0)