mbox series

[0/1] Bluetooth: mgmt: Add command for getting device IO capabilities.

Message ID 20240210222226.890031-1-vibhavp@gmail.com
Headers show
Series Bluetooth: mgmt: Add command for getting device IO capabilities. | expand

Message

Vibhav Pant Feb. 10, 2024, 10:22 p.m. UTC
The following patch adds a new command to the bluetooth management interface,
GET_DEVICE_IO_CAPABILITY. The command allows userspace to get the IO capability,
and the authentication methods supported by a connected device. The command is
necessary in order to implement parts of the Win32 Bluetooth API in the Wine,
specifically the following two structs:

* BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, which provides IO and auth capabilities
info for an incoming authentication request from a device.

* BTH_DEVICE_INFO, which contains flags indicating whether the device supports
Simple Secure Pairing and MITM protection. The former is supported through BlueZ's
"LegacyPairing" property.

Because the Wine API are implemented on top of BlueZ, I'll also be providing a
corresponding patch that uses the newly added management command to expose the
capabilities through new properties in the org.bluez.Device1 interface.

Thanks,
Vibhav

Vibhav Pant (1):
  Bluetooth: mgmt: Add command for getting device IO capabilities.

 include/net/bluetooth/mgmt.h | 19 ++++++++
 net/bluetooth/mgmt.c         | 89 ++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)

Comments

Luiz Augusto von Dentz Feb. 11, 2024, 3:57 p.m. UTC | #1
Hi Vibhav,

On Sat, Feb 10, 2024 at 5:22 PM Vibhav Pant <vibhavp@gmail.com> wrote:
>
> The following patch adds a new command to the bluetooth management interface,
> GET_DEVICE_IO_CAPABILITY. The command allows userspace to get the IO capability,
> and the authentication methods supported by a connected device. The command is
> necessary in order to implement parts of the Win32 Bluetooth API in the Wine,
> specifically the following two structs:
>
> * BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, which provides IO and auth capabilities
> info for an incoming authentication request from a device.
>
> * BTH_DEVICE_INFO, which contains flags indicating whether the device supports
> Simple Secure Pairing and MITM protection. The former is supported through BlueZ's
> "LegacyPairing" property.
>
> Because the Wine API are implemented on top of BlueZ, I'll also be providing a
> corresponding patch that uses the newly added management command to expose the
> capabilities through new properties in the org.bluez.Device1 interface.

Interesting, but the IO capability matching logic lives under the
kernel so I wonder how useful this information is if you can't really
do much about the authentication method used? And in case you are
thinking of changing the pairing procedure to just leave it up to the
upper layer to figure it out, I don't think that is a good idea
because that is subject to qualification that would effectively be a
new implementation.

> Thanks,
> Vibhav
>
> Vibhav Pant (1):
>   Bluetooth: mgmt: Add command for getting device IO capabilities.
>
>  include/net/bluetooth/mgmt.h | 19 ++++++++
>  net/bluetooth/mgmt.c         | 89 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 108 insertions(+)
>
> --
> 2.43.0
>
>