All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 5/5] l2cap-tester: Set IO capability in Client SSP - Success 2
Date: Fri, 20 Nov 2026 10:47:50 -0500	[thread overview]
Message-ID: <20261120154750.1745643-6-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20261120154750.1745643-1-luiz.dentz@gmail.com>

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

L2CAP BR/EDR Client SSP - Success 2 connects with BT_SECURITY_HIGH but
doesn't set the IO capability, which defaults to NoInputNoOutput, so
pairing results in an unauthenticated key and the test only passes
because the kernel lowers the security level of the channel to the one
of the link.

Set the IO capability to DisplayYesNo so pairing results in an
authenticated key and the security level requested is met.

Assisted-by: OpenCode:claude-fable-5.2
---
 tools/l2cap-tester.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index 7004955a1af7..da10954075e9 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -98,6 +98,7 @@ struct l2cap_data {
 	const void *write_data;
 
 	bool enable_ssp;
+	uint8_t io_cap;
 	uint8_t client_io_cap;
 	int sec_level;
 	bool reject_ssp;
@@ -393,6 +394,7 @@ static const struct l2cap_data client_connect_ssp_success_test_2 = {
 	.server_psm = 0x1001,
 	.enable_ssp = true,
 	.sec_level  = BT_SECURITY_HIGH,
+	.io_cap = 0x01,
 	.client_io_cap = 0x04,
 };
 
@@ -2342,6 +2344,16 @@ static void setup_powered_common(void)
 				data->mgmt_index, pin_code_request_callback,
 				data, NULL);
 
+	if (test && test->io_cap) {
+		struct mgmt_cp_set_io_capability cp;
+
+		cp.io_capability = test->io_cap;
+
+		mgmt_send(data->mgmt, MGMT_OP_SET_IO_CAPABILITY,
+				data->mgmt_index, sizeof(cp), &cp,
+				NULL, NULL, NULL);
+	}
+
 	if (test && test->client_io_cap)
 		bthost_set_io_capability(bthost, test->client_io_cap);
 
-- 
2.56.0


      parent reply	other threads:[~2026-11-20 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:47 [PATCH BlueZ v2 0/5] Add tests for security of deferred setup Luiz Augusto von Dentz
2026-11-20 15:47 ` [PATCH BlueZ v2 1/5] emulator/bthost: Add helpers to test " Luiz Augusto von Dentz
2026-11-20 22:28   ` Add tests for " bluez.test.bot
2026-11-20 15:47 ` [PATCH BlueZ v2 2/5] emulator/btdev: Add btdev_set_link_key_type Luiz Augusto von Dentz
2026-11-20 15:47 ` [PATCH BlueZ v2 3/5] l2cap-tester: Add tests for security of deferred setup Luiz Augusto von Dentz
2026-11-20 15:47 ` [PATCH BlueZ v2 4/5] rfcomm-tester: Add tests for " Luiz Augusto von Dentz
2026-11-20 15:47 ` Luiz Augusto von Dentz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120154750.1745643-6-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.