diff mbox series

[BlueZ,v2,1/2] device: Attempt to elevate security on Pair while connected

Message ID 20250324204550.2196697-1-luiz.dentz@gmail.com
State Superseded
Headers show
Series [BlueZ,v2,1/2] device: Attempt to elevate security on Pair while connected | expand

Commit Message

Luiz Augusto von Dentz March 24, 2025, 8:45 p.m. UTC
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(-)

Comments

bluez.test.bot@gmail.com March 24, 2025, 10:10 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=946951

---Test result---

Test Summary:
CheckPatch                    PENDING   0.51 seconds
GitLint                       PENDING   0.22 seconds
BuildEll                      PASS      20.39 seconds
BluezMake                     PASS      1517.36 seconds
MakeCheck                     PASS      13.08 seconds
MakeDistcheck                 PASS      155.76 seconds
CheckValgrind                 PASS      212.67 seconds
CheckSmatch                   PASS      286.63 seconds
bluezmakeextell               PASS      99.19 seconds
IncrementalBuild              PENDING   0.31 seconds
ScanBuild                     PASS      904.50 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 57577e57920a..a04eebe1dff6 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3185,10 +3185,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);