Re: Authentication Rejected when pairing stereo headset

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

 



Hi Andrey,

On Thu, Dec 20, 2012 at 10:27:15AM +0100, Andrey Voropaev wrote:
> On Thu, Dec 20, 2012 at 10:19 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
> > First of all, please don't do top posting. It messes up the thread,
> > especially when mixed with inline quoting.
> 
> Sorry. First time replying to list from gmail. Didn't pay attention to
> that little mark at the bottom of the editor :)
> 
> > Actually the hcidump helped a lot. It shows an issue on the kernel side:
> >
> >  < HCI Command: IO Capability Request Reply (0x01|0x002b) plen 9
> >      bdaddr 00:1A:7D:25:2C:A4 capability 0x04 oob 0x00 auth 0x03
> >      Capability: Reserved (OOB data not present)
> >      Authentication: Dedicated Bonding (MITM Protection)
> >  > HCI Event: Command Complete (0x0e) plen 10
> >      IO Capability Request Reply (0x01|0x002b) ncmd 1
> >      status 0x12 bdaddr 00:1A:7D:25:2C:A4
> >      Error: Invalid HCI Command Parameters
> >
> > The IO capability value 0x04 that the kernel is responding with is
> > invalid and shouldn't be sent to the controller. This was already fixed
> > quite long time ago (about 1 year ago) by the following patch from
> > Hemant Gupta: "Bluetooth: Send correct response to IO Capability Request"
> >
> > It adds the following code to the IO capability handling to avoid 0x04
> > from being sent:
> >
> >         /* Change the IO capability from KeyboardDisplay
> >          * to DisplayYesNo as it is not supported by BT spec. */
> >         cp.capability = (conn->io_capability == 0x04) ?
> >                                         0x01 : conn->io_capability;
> >
> > It seems however that your kernel is missing this patch and the right
> > way forward would be to include it.
> 
> I'm using Gentoo with "stable" version 3.5.7. Can you please tell me
> which file shall contain this patch? I'll try to find "development"
> version of kernel that contains it.

The patch is below:

commit 7a7f1e7c857959f5298020969741e389f21edbae
Author: Hemant Gupta <hemant.gupta@xxxxxxxxxxxxxx>
Date:   Mon Jan 16 13:34:29 2012 +0530

    Bluetooth: Send correct response to IO Capability Request
    
    This patch sends correct IO Capability response to remote device
    in case Local Device supports KeyBoardDisplay IO Capability as
    this capability is not valid as per BT spec for IO capability
    Request Reply Command.
    This capability is mapped to DisplayYesNo which is in accordance
    with BT spec.
    
    Signed-off-by: Hemant Gupta <hemant.gupta@xxxxxxxxxxxxxx>
    Acked-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
    Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx>

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 6fb9016..041a35e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2965,7 +2965,10 @@ static inline void hci_io_capa_request_evt(struct
hci_dev *hdev, struct sk_buff
                struct hci_cp_io_capability_reply cp;
 
                bacpy(&cp.bdaddr, &ev->bdaddr);
-               cp.capability = conn->io_capability;
+               /* Change the IO capability from KeyboardDisplay
+                * to DisplayYesNo as it is not supported by BT spec. */
+               cp.capability = (conn->io_capability == 0x04) ?
+                                               0x01 :
conn->io_capability;
                conn->auth_type = hci_get_auth_req(conn);
                cp.authentication = conn->auth_type;


Best regards 
Andrei Emeltchenko 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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