Bluetooth: Kconfig: Introduce new BT_SCAN_WITH_IDENTITY option
Even with the privacy feature disabled, the stack has so far defaulted to using an NRPA for active scanning, in order to protect privacy. This is mainly because it is not always clear that scanning for other devices may risk revealing the local identity. There may however be use cases where such revealing is actively desired, so introduce a new option for this (which defaults to disabled). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
35d0592a39
commit
86c32aac1c
2 changed files with 15 additions and 2 deletions
|
@ -301,6 +301,16 @@ config BT_MAX_PAIRED
|
||||||
|
|
||||||
endif # BT_CONN
|
endif # BT_CONN
|
||||||
|
|
||||||
|
config BT_SCAN_WITH_IDENTITY
|
||||||
|
bool "Perform active scanning using local identity address"
|
||||||
|
depends on !BT_PRIVACY && (BT_CENTRAL || BT_OBSERVER)
|
||||||
|
help
|
||||||
|
Enable this if you want to perform active scanning using the local
|
||||||
|
identy address as the scanner address. By default the stack will
|
||||||
|
always use a non-resolvable private address (NRPA) in order to avoid
|
||||||
|
disclosing local identity information. However, if the use case
|
||||||
|
requires disclosing it then enable this option.
|
||||||
|
|
||||||
config BT_DEVICE_NAME
|
config BT_DEVICE_NAME
|
||||||
string "Bluetooth device name"
|
string "Bluetooth device name"
|
||||||
default "Zephyr"
|
default "Zephyr"
|
||||||
|
|
|
@ -2923,8 +2923,11 @@ static int start_le_scan(u8_t scan_type, u16_t interval, u16_t window)
|
||||||
} else {
|
} else {
|
||||||
set_param->addr_type = bt_dev.id_addr.type;
|
set_param->addr_type = bt_dev.id_addr.type;
|
||||||
|
|
||||||
/* only set NRPA if there is no advertising ongoing */
|
/* Use NRPA unless identity has been explicitly requested
|
||||||
if (scan_type == BT_HCI_LE_SCAN_ACTIVE &&
|
* (through Kconfig), or if there is no advertising ongoing.
|
||||||
|
*/
|
||||||
|
if (!IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) &&
|
||||||
|
scan_type == BT_HCI_LE_SCAN_ACTIVE &&
|
||||||
!atomic_test_bit(bt_dev.flags, BT_DEV_ADVERTISING)) {
|
!atomic_test_bit(bt_dev.flags, BT_DEV_ADVERTISING)) {
|
||||||
err = le_set_private_addr();
|
err = le_set_private_addr();
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue