linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] client/player: Allow the user to control BIG encryption
@ 2023-09-21 10:39 Vlad Pruteanu
  2023-09-21 10:39 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
  0 siblings, 1 reply; 5+ messages in thread
From: Vlad Pruteanu @ 2023-09-21 10:39 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, silviu.barbulescu, iulia.tanasescu,
	andrei.istodorescu, mihai-octavian.urzica, Vlad Pruteanu

This commit adds support for controling the use of encryption and
setting the broadcast code. This is done as part of the endpoint.config
command. For source endpoints the encryption flag and broadcast code can
be set, while the sink supports only broadcast code setting. If no custom
broadcast code is provided, the default one will be used.

Vlad Pruteanu (1):
  client/player: Allow the user to control the use of encryption

 client/player.c | 50 ++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 43 insertions(+), 7 deletions(-)

-- 
2.39.2


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

* [PATCH BlueZ 1/1] client/player: Allow the user to control BIG encryption
  2023-09-21 10:39 [PATCH BlueZ 0/1] client/player: Allow the user to control BIG encryption Vlad Pruteanu
@ 2023-09-21 10:39 ` Vlad Pruteanu
  2023-09-21 19:02   ` bluez.test.bot
  0 siblings, 1 reply; 5+ messages in thread
From: Vlad Pruteanu @ 2023-09-21 10:39 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, silviu.barbulescu, iulia.tanasescu,
	andrei.istodorescu, mihai-octavian.urzica, Vlad Pruteanu

This commit adds support for controling the use of encryption and
setting the broadcast code. This is done as part of the endpoint.config
command. For source endpoints the encryption flag and broadcast code can
be set, while the sink supports only broadcast code setting. If no custom
broadcast code is provided, the default one will be used.
---
 client/player.c | 50 ++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 43 insertions(+), 7 deletions(-)

diff --git a/client/player.c b/client/player.c
index 42721c210..492a1ce54 100644
--- a/client/player.c
+++ b/client/player.c
@@ -2750,10 +2750,10 @@ static void cmd_config_endpoint(int argc, char *argv[])
 	const struct capabilities *cap;
 	char *uuid;
 	uint8_t codec_id;
-	bool broadcast = false;
+	bool local_ep_not_provided = false;
+	uint8_t bcode_arg_position = 0;
 
 	cfg = new0(struct endpoint_config, 1);
-
 	/* Search for the remote endpoint name on DBUS */
 	cfg->proxy = g_dbus_proxy_lookup(endpoints, NULL, argv[1],
 						BLUEZ_MEDIA_ENDPOINT_INTERFACE);
@@ -2773,7 +2773,7 @@ static void cmd_config_endpoint(int argc, char *argv[])
 		codec_id = strtol(argv[3], NULL, 0);
 		cap = find_capabilities(uuid, codec_id);
 		if (cap) {
-			broadcast = true;
+			local_ep_not_provided = true;
 			cfg->ep = endpoint_new(cap);
 			cfg->ep->preset = find_presets_name(uuid, argv[3]);
 			if (!cfg->ep->preset)
@@ -2785,9 +2785,10 @@ static void cmd_config_endpoint(int argc, char *argv[])
 		}
 	}
 
-	if (((broadcast == false) && (argc > 3)) ||
-		((broadcast == true) && (argc > 4))) {
-		char *preset_name = (broadcast == false)?argv[3]:argv[4];
+	if (((local_ep_not_provided == false) && (argc > 3)) ||
+		((local_ep_not_provided == true) && (argc > 4))) {
+		uint8_t offset = (local_ep_not_provided == false)?0:1;
+		char *preset_name = argv[3 + offset];
 
 		preset = preset_find_name(cfg->ep->preset, preset_name);
 		if (!preset) {
@@ -2795,7 +2796,42 @@ static void cmd_config_endpoint(int argc, char *argv[])
 			goto fail;
 		}
 
+		/* If the endpoint is configured to be a source allow
+		 *the user to decide if encryption is enabled or not.
+		 */
+		if (!strcmp(cfg->ep->uuid, BCAA_SERVICE_UUID) &&
+			argc > 4 + offset) {
+			uint8_t value = strtol(argv[4 + offset],
+							NULL, 0);
+
+			if (value < 2)
+				bcast_qos.bcast.encryption = value;
+			else
+				goto fail;
+		}
+
+		/* If the endpoint is configured to be a source or a
+		 *sink allow the user to set a custom broadcast code.
+		 *If no broadcast code is set, the default will be used.
+		 */
+		if (!strcmp(cfg->ep->uuid, BCAA_SERVICE_UUID) &&
+			(argc > 5 + offset))
+			bcode_arg_position = 5 + offset;
+
+		/*The broadcast code is found at a smaller index due to the sink
+		 *config not using the encryption flag parameter.
+		 */
+		if (!strcmp(cfg->ep->uuid, BAA_SERVICE_UUID) &&
+			argc > 4 + offset)
+			bcode_arg_position = 4  + offset;
+
+		if (bcode_arg_position != 0)
+			for (uint8_t i = 0; i < 16; i++)
+				bcast_qos.bcast.bcode[i] =
+				strtol(argv[bcode_arg_position + i], NULL, 16);
+
 		if (cfg->ep->broadcast) {
+
 			iov_append(&cfg->ep->bcode, bcast_qos.bcast.bcode,
 				sizeof(bcast_qos.bcast.bcode));
 			/* Copy capabilities for broadcast*/
@@ -3213,7 +3249,7 @@ static const struct bt_shell_menu endpoint_menu = {
 						"Register Endpoint",
 						local_endpoint_generator },
 	{ "config",
-		"<endpoint> [local endpoint/UUID] [preset/codec id] [preset]",
+		"<endpoint> [local endpoint/UUID] [preset/codec id] [preset] [encryption] [broadcast code=xx xx ...]",
 						cmd_config_endpoint,
 						"Configure Endpoint",
 						endpoint_generator },
-- 
2.39.2


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

* RE: client/player: Allow the user to control BIG encryption
  2023-09-21 10:39 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
@ 2023-09-21 19:02   ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2023-09-21 19:02 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

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=786290

---Test result---

Test Summary:
CheckPatch                    PASS      0.48 seconds
GitLint                       PASS      0.28 seconds
BuildEll                      PASS      37.16 seconds
BluezMake                     PASS      1261.17 seconds
MakeCheck                     PASS      13.59 seconds
MakeDistcheck                 PASS      211.70 seconds
CheckValgrind                 PASS      338.49 seconds
CheckSmatch                   PASS      472.16 seconds
bluezmakeextell               PASS      142.40 seconds
IncrementalBuild              PASS      1072.57 seconds
ScanBuild                     PASS      1491.32 seconds



---
Regards,
Linux Bluetooth


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

* RE: client/player: Allow the user to control BIG encryption
  2023-10-02 12:37 [PATCH BlueZ 1/1] " Vlad Pruteanu
@ 2023-10-02 13:50 ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2023-10-02 13:50 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

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=789283

---Test result---

Test Summary:
CheckPatch                    PASS      0.57 seconds
GitLint                       PASS      0.35 seconds
BuildEll                      PASS      27.66 seconds
BluezMake                     PASS      785.70 seconds
MakeCheck                     PASS      11.74 seconds
MakeDistcheck                 PASS      160.64 seconds
CheckValgrind                 PASS      257.83 seconds
CheckSmatch                   PASS      350.25 seconds
bluezmakeextell               PASS      106.06 seconds
IncrementalBuild              PASS      687.48 seconds
ScanBuild                     PASS      1039.99 seconds



---
Regards,
Linux Bluetooth


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

* RE: client/player: Allow the user to control BIG encryption
  2023-12-20 10:21 [PATCH BlueZ 1/1] " Vlad Pruteanu
@ 2023-12-20 11:30 ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2023-12-20 11:30 UTC (permalink / raw)
  To: linux-bluetooth, vlad.pruteanu

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

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=811757

---Test result---

Test Summary:
CheckPatch                    PASS      0.53 seconds
GitLint                       PASS      0.34 seconds
BuildEll                      PASS      24.26 seconds
BluezMake                     PASS      733.48 seconds
MakeCheck                     PASS      12.25 seconds
MakeDistcheck                 PASS      162.01 seconds
CheckValgrind                 PASS      225.43 seconds
CheckSmatch                   PASS      331.18 seconds
bluezmakeextell               PASS      106.57 seconds
IncrementalBuild              PASS      673.82 seconds
ScanBuild                     PASS      934.84 seconds



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2023-12-20 11:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 10:39 [PATCH BlueZ 0/1] client/player: Allow the user to control BIG encryption Vlad Pruteanu
2023-09-21 10:39 ` [PATCH BlueZ 1/1] " Vlad Pruteanu
2023-09-21 19:02   ` bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02 12:37 [PATCH BlueZ 1/1] " Vlad Pruteanu
2023-10-02 13:50 ` bluez.test.bot
2023-12-20 10:21 [PATCH BlueZ 1/1] " Vlad Pruteanu
2023-12-20 11:30 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).