[PATCH BlueZ v2 5/5] device: Elevate bt_att security if bonding is in progress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

When bonding is in progress it means Device.Pair has been called thus
the user indicated the intend to pair/bond from the start so the
security of bt_att shall be set in order for it to wait until pairing
process complete before attempting to proceed with GATT discovery and
any other traffic.

Fixes: https://github.com/bluez/bluez/issues/1125
---
 src/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/device.c b/src/device.c
index 034491b59d30..057d116be6fc 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5797,6 +5797,11 @@ static void gatt_client_init(struct btd_device *device)
 	if (btd_opts.gatt_channels > 1)
 		features |= BT_GATT_CHRC_CLI_FEAT_EATT;
 
+	if (device->bonding) {
+		DBG("Elevating security level since bonding is in progress");
+		bt_att_set_security(device->att, BT_ATT_SECURITY_MEDIUM);
+	}
+
 	device->client = bt_gatt_client_new(device->db, device->att,
 						device->att_mtu, features);
 	if (!device->client) {
-- 
2.48.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux