Skip to content

Commit

Permalink
Bluetooth: Add Kconfig option to disable bondable mode
Browse files Browse the repository at this point in the history
This adds Kconfig option to allow disable bondable mode in compile
time.

Signed-off-by: Mariusz Skamra <[email protected]>
  • Loading branch information
MariuszSkamra authored and jhedberg committed Sep 19, 2018
1 parent 64e608b commit 7ff9eee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions subsys/bluetooth/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ config BT_USE_DEBUG_KEYS
If this option is enabled anyone is able to decipher encrypted air
traffic.

config BT_BONDABLE
bool "Bondable Mode"
default y
help
This option enables support for Bondable Mode. In this mode,
Bonding flag in AuthReq of SMP Pairing Request/Response will be set
indicating the support for this mode.

endif # BT_SMP

config BT_L2CAP_DYNAMIC_CHANNEL
Expand Down
10 changes: 8 additions & 2 deletions subsys/bluetooth/host/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,19 @@

#define BT_SMP_AUTH_MASK 0x07

#if defined(CONFIG_BT_BONDABLE)
#define BT_SMP_AUTH_BONDING_FLAGS BT_SMP_AUTH_BONDING
#else
#define BT_SMP_AUTH_BONDING_FLAGS 0
#endif /* CONFIG_BT_BONDABLE */

#if defined(CONFIG_BT_BREDR)
#define BT_SMP_AUTH_MASK_SC 0x2f
#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING | BT_SMP_AUTH_SC |\
#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_SC |\
BT_SMP_AUTH_CT2)
#else
#define BT_SMP_AUTH_MASK_SC 0x0f
#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING | BT_SMP_AUTH_SC)
#define BT_SMP_AUTH_DEFAULT (BT_SMP_AUTH_BONDING_FLAGS | BT_SMP_AUTH_SC)
#endif

enum pairing_method {
Expand Down

0 comments on commit 7ff9eee

Please sign in to comment.