Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2848572rdb; Tue, 12 Sep 2023 14:11:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZ8Z8KBphyHwxMroZ4SBAz+usOscVU50+ARt7FlpETiaPWD43hxuJvDNHtyYkArbylD1Gu X-Received: by 2002:a17:90b:603:b0:273:f584:40ca with SMTP id gb3-20020a17090b060300b00273f58440camr510143pjb.16.1694553093920; Tue, 12 Sep 2023 14:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694553093; cv=none; d=google.com; s=arc-20160816; b=prCx1b2CsbJIEENth1pVrJtoZIWoGk6oxLmG7LvNsfkPbTSLoDognKyPc7KDHzJzBU S4jx3dWZt7+h8mZjwXuUTgjvCmj/yWlakF82l1+GO+qVBT/bZ0fSRi3eI/TKXteCH69W sG9OYeJ9PreKf9TwuHe1fCr6h21KLFaBThVZpRYlCInpZwF2I37B9VgAmFw95za1k4PT GTdIGneqEHwtAOEfIDn6KPbFjuymC5cS3BI/SdVrRI4+kclm2b2cJxpwKOWjDWnSPSyq ALtRaqNF3MuQ/Qne0q9/oP4K/k+wEbKAoGkW9PVCxp9HqSaXYZMgyslOYGAH5UEZE+65 dNqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LBhQ9qOAt6jcxWqQxJRGLV08DPG1cn/4qLbmtM7lNXM=; fh=jsxxaw+wJjMKM8ZsQrpETzyqbxEjAqZmuXlIq1U/rkQ=; b=qgyQXeI6Z/gPh/cQ2XgFH0WofZ+qFkKHL2Caxk8Qg0WPoQ0kOmLwZs14/pYPqorJZh FH8eJmWZDvyIOTXfuZVuNyYQeWdYGFism15cJQg/SteeH/eE7CJtqLSS5K28XgHXO31Q 0oQJD8UEmQGj+sBos9TqiK1F+A7pXoPgQgJMEK8TKG2B2RttU2sjkvCVs6baS+gB836B j83awSsWJ5dyoPVtVH36IA8FPXYNwCFzXkge+418pUg7z8lhu6WKDE+wXEkVJ55eUALr rjXOsc/FtGKwt2Zjnj40FyXPPP9JHuD7AYyb3w9JQwCgcBd5Lq9YYpjUr073tlkVHSFZ WU8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MrVTn3yR; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id oa3-20020a17090b1bc300b0025de453ee4csi80951pjb.168.2023.09.12.14.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 14:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MrVTn3yR; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7670B825F17F; Tue, 12 Sep 2023 11:29:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234962AbjILS3M (ORCPT + 99 others); Tue, 12 Sep 2023 14:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232721AbjILS3L (ORCPT ); Tue, 12 Sep 2023 14:29:11 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DCEF189 for ; Tue, 12 Sep 2023 11:29:07 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bcc331f942so1625431fa.0 for ; Tue, 12 Sep 2023 11:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694543346; x=1695148146; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LBhQ9qOAt6jcxWqQxJRGLV08DPG1cn/4qLbmtM7lNXM=; b=MrVTn3yRMW+2jdKjTXcp8D/gDziBU5pJAoEpxUNGrZ1lkhzbdTbHqHlBuF6U7fbZLv idBFuDJz11c3u5CuUGXUAeKeh8z5ImdqBPhKLwtacpNxi/ICZNsQ5p5dZh4+oKZvqs2n 73C1D93DIvqIw+M4DgO96CX8Hmomy/Fmqh2dlgpltF0fyYgEg/fOMALilGBelTMHsU/R hzF+cnmXXvCn8d5K44BlZ7PmZvIL5BbbvqDHHy435pf4HhlbvtMNqoPfajcN0iOd94zr DNgT+KoCGrm8pBo5qqsozIUwHMrhUo2t3ZKvqYZTEjpJmJpJ41gxH+DIvKXUw6AK4k+E 6Uww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694543346; x=1695148146; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LBhQ9qOAt6jcxWqQxJRGLV08DPG1cn/4qLbmtM7lNXM=; b=Xbn4jQdteUk87I0G181u392kmnWeKCuQXdf8DdEovxNcfQuLthBzTgemVRc796xduj CeBlrlRMmCrrIer3bqaW1L2i74VsNFJn+p/svrFs7FphPhavn5OuSlDhmubcPIm3lqbc rnE6cx9ImSncWDKjqzIvrtZwsL07Y90JCUIxk8NeOS/OHf5EEfLTqeSG/WEbNS3vtBee IR9rdh1s9mGG1OmluM2NbkP2JackiTKmk4mdg04Z4KbFozLt8e8sYJ6tFvxMCj0bGiC0 ug+lNT3yX7vfMJKEwqyRK0oi9wKXkAutT5Cib0GpjKleTedrib8+IeEecAmLCGujMzBq sZHQ== X-Gm-Message-State: AOJu0Ywc0xbYHrh0xGwYfliZhGqWvZ/c5js2G/lHGuHZS48Zs1zomzEt WP35oJ8BV1tHDNqt0OWQFrM08gpSOuolhDB+Z2M= X-Received: by 2002:a2e:380b:0:b0:2bc:bc6f:e296 with SMTP id f11-20020a2e380b000000b002bcbc6fe296mr140090lja.13.1694543345495; Tue, 12 Sep 2023 11:29:05 -0700 (PDT) MIME-Version: 1.0 References: <20230912064026.1203509-1-vlad.pruteanu@nxp.com> <20230912064026.1203509-2-vlad.pruteanu@nxp.com> In-Reply-To: <20230912064026.1203509-2-vlad.pruteanu@nxp.com> From: Luiz Augusto von Dentz Date: Tue, 12 Sep 2023 11:28:53 -0700 Message-ID: Subject: Re: [PATCH BlueZ 1/1] client/player: Add command for control of BIS encryption To: Vlad Pruteanu Cc: linux-bluetooth@vger.kernel.org, claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 11:29:10 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Hi Vlad, On Mon, Sep 11, 2023 at 11:44=E2=80=AFPM Vlad Pruteanu wrote: > > Currently there is no way to set the BIS encryption from > the bluetoothctl application. This commit adds support > for one. > > Usage: > encryption [on/off] Don't really like the idea of having encryption here, I'd prompt the user asking if he wants encryption as part of endpoint.config when we detect it is for broadcast and if he responds yes then we can prompt for the key as well. > --- > client/player.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/client/player.c b/client/player.c > index 42721c210..b1da5e839 100644 > --- a/client/player.c > +++ b/client/player.c > @@ -3196,6 +3196,28 @@ done: > return bt_shell_noninteractive_quit(EXIT_SUCCESS); > } > > +static void cmd_encryption_endpoint(int argc, char *argv[]) > +{ > + > + uint8_t value; > + > + if (argc < 2) { > + bt_shell_printf("Encryption: %s\n", > + bcast_qos.bcast.encryption ? "on" : "off"= ); > + return bt_shell_noninteractive_quit(EXIT_SUCCESS); > + } > + > + if (!strcmp(argv[1], "on") || !strcmp(argv[1], "yes")) > + value =3D 1; > + else if (!strcmp(argv[1], "off") || !strcmp(argv[1], "no")) > + value =3D 0; > + else > + return bt_shell_noninteractive_quit(EXIT_FAILURE); > + > + bcast_qos.bcast.encryption =3D value; > + return bt_shell_noninteractive_quit(EXIT_SUCCESS); > +} > + > static const struct bt_shell_menu endpoint_menu =3D { > .name =3D "endpoint", > .desc =3D "Media Endpoint Submenu", > @@ -3221,6 +3243,10 @@ static const struct bt_shell_menu endpoint_menu = =3D { > cmd_presets_endpoint, > "List available presets", > uuid_generator }, > + { "encryption", "[on/off]", > + cmd_encryption_endpoint, > + "Enable/disable BIS encry= ption (mode 3 security)", > + NULL }, > {} }, > }; > > -- > 2.34.1 > --=20 Luiz Augusto von Dentz