Skip to content

Commit 9ac0bf6

Browse files
HaavardReim-alperen-sener
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 <[email protected]> (cherry picked from commit 82cfb5a) Signed-off-by: alperen sener <[email protected]>
1 parent b28679f commit 9ac0bf6

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
@@ -2397,8 +2397,8 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn,
23972397
const struct bt_le_oob_sc_data **oobd_remote);
23982398

23992399
/**
2400-
* Special passkey value that can be used to disable a previously
2401-
* set fixed passkey.
2400+
* DEPRECATED - use @ref BT_PASSKEY_RAND instead. Special passkey value that can be used to disable
2401+
* a previously set fixed passkey.
24022402
*/
24032403
#define BT_PASSKEY_INVALID 0xffffffff
24042404

@@ -2410,12 +2410,15 @@ int bt_le_oob_get_sc_data(struct bt_conn *conn,
24102410
* Sets a fixed passkey to be used for pairing. If set, the
24112411
* pairing_confirm() callback will be called for all incoming pairings.
24122412
*
2413+
* @deprecated Use @ref BT_PASSKEY_RAND and the app_passkey callback from @ref bt_conn_auth_cb
2414+
* instead.
2415+
*
24132416
* @param passkey A valid passkey (0 - 999999) or BT_PASSKEY_INVALID
24142417
* to disable a previously set fixed passkey.
24152418
*
24162419
* @return 0 on success or a negative error code on failure.
24172420
*/
2418-
int bt_passkey_set(unsigned int passkey);
2421+
__deprecated int bt_passkey_set(unsigned int passkey);
24192422

24202423
/** Info Structure for OOB pairing */
24212424
struct bt_conn_oob_info {

subsys/bluetooth/host/Kconfig

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

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

0 commit comments

Comments
 (0)