Re: [PATCH BlueZ v3 6/7] adapter: Set server security level in load_devices()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ludovico,

On Thu, Apr 24, 2025 at 11:10 AM Ludovico de Nittis
<ludovico.denittis@xxxxxxxxxxxxx> wrote:
>
> Hi Luiz,
>
> On 4/24/25 4:57 PM, Luiz Augusto von Dentz wrote:
> > Hi Ludovico,
> >
> > On Thu, Apr 24, 2025 at 10:50 AM Ludovico de Nittis
> > <ludovico.denittis@xxxxxxxxxxxxx> wrote:
> >> After loading known devices from storage, change the security level if
> >> we have a device with `CablePairing`.
> >> This will allow it to successfully establish a connection.
> >> ---
> >>   src/adapter.c | 7 +++++++
> >>   1 file changed, 7 insertions(+)
> >>
> >> diff --git a/src/adapter.c b/src/adapter.c
> >> index fd425e6d2..8d875013c 100644
> >> --- a/src/adapter.c
> >> +++ b/src/adapter.c
> >> @@ -68,6 +68,7 @@
> >>   #include "adv_monitor.h"
> >>   #include "eir.h"
> >>   #include "battery.h"
> >> +#include "profiles/input/server.h"
> >>
> >>   #define MODE_OFF               0x00
> >>   #define MODE_CONNECTABLE       0x01
> >> @@ -5090,6 +5091,12 @@ free:
> >>                  g_key_file_free(key_file);
> >>          }
> >>
> >> +       if (btd_adapter_has_cable_pairing_devices(adapter)) {
> >> +               DBG("There is at least one known cable paired device, setting the "
> >> +                       "listening input server security level accordingly");
> >> +               server_set_cable_pairing(&adapter->bdaddr, true);
> >> +       }
> > This creates a dependency on the input which is a plugin that can be
> > excluded/not loaded at runtime, so we can't really do this at daemon
> > core.
>
> Do you have any suggestions on how to shuffle this around to avoid calling
> `server_set_cable_pairing()` directly from `adapter.c`? Because in
> theory that
> should still happen after we ensured  we loaded all devices from storage.

We should probably evaluate this on probe, if the device has been
marked with cable pairing flag then it should call
server_set_cable_pairing, if we cannot evaluate it at that point then
we need some callback mechanism to notify the plugin when the cable
pairing property changes.

> >>          closedir(dir);
> >>
> >>          load_link_keys(adapter, keys, btd_opts.debug_keys);
> >> --
> >> 2.49.0
> >>
> >>
> >
>


-- 
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux