All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/5] device: Attempt to elevate security on Pair while connected
@ 2025-03-26 19:31 Luiz Augusto von Dentz
  2025-03-26 19:31 ` [PATCH BlueZ v2 2/5] device: Make Connect and Pair mutually exclusive Luiz Augusto von Dentz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2025-03-26 19:31 UTC (permalink / raw)
  To: linux-bluetooth

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

This would make Pair act behave the same as when the device reconnect
and bonding already exists.
---
 src/device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 9774b5bf1b96..f76c1ec3eabf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3194,10 +3194,13 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg,
 
 		if (!state->connected && btd_le_connect_before_pairing())
 			err = device_connect_le(device);
-		else
+		else if (!state->connected || !bt_att_set_security(device->att,
+						BT_ATT_SECURITY_MEDIUM))
 			err = adapter_create_bonding(adapter, &device->bdaddr,
 							device->bdaddr_type,
 							io_cap);
+		else
+			err = 0;
 	} else {
 		err = adapter_create_bonding(adapter, &device->bdaddr,
 							BDADDR_BREDR, io_cap);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-27 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 19:31 [PATCH BlueZ v2 1/5] device: Attempt to elevate security on Pair while connected Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 2/5] device: Make Connect and Pair mutually exclusive Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 3/5] device: Use btd_device_is_initiator instead of Connect message Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 4/5] shared/att: Make bt_att_set_security never downgrade security level Luiz Augusto von Dentz
2025-03-26 19:31 ` [PATCH BlueZ v2 5/5] device: Elevate bt_att security if bonding is in progress Luiz Augusto von Dentz
2025-03-26 20:31 ` [BlueZ,v2,1/5] device: Attempt to elevate security on Pair while connected bluez.test.bot
2025-03-27 16:10 ` [PATCH BlueZ v2 1/5] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.