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, Andrey Voropaev wrote:
> > 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 file involved is net/bluetooth/hci_event.c. I've attached the patch
to this email.

An quicker way for you to overcome the issue is to change the user space
side pairing call to pass "DisplayYesNo" instead of "KeyboardDisplay" to
BlueZ. I.e. edit the simple-agent script, find the (two) occurrences of
"KeyboardDisplay" and change them to "DisplayYesNo" and try to pair
again.

Johan
>From 7a7f1e7c857959f5298020969741e389f21edbae Mon Sep 17 00:00:00 2001
From: Hemant Gupta <hemant.gupta@xxxxxxxxxxxxxx>
Date: Mon, 16 Jan 2012 13:34:29 +0530
Subject: [PATCH] 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>
---
 net/bluetooth/hci_event.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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;
 
-- 
1.8.0.2


[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