public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
@ 2009-07-02 13:57 Andrei Emeltchenko
  2009-08-14 13:44 ` Andrei Emeltchenko
  2009-09-02  9:50 ` Marcel Holtmann
  0 siblings, 2 replies; 7+ messages in thread
From: Andrei Emeltchenko @ 2009-07-02 13:57 UTC (permalink / raw)
  To: linux-bluetooth

Hi,
I have a simple patch which fixes issues with SSP mentioned below.

---
 net/bluetooth/hci_conn.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index fa47d5d..d863bda 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev
*hdev, int type, bdaddr_t *dst)
 	conn->type  = type;
 	conn->mode  = HCI_CM_ACTIVE;
 	conn->state = BT_OPEN;
+	conn->auth_type = HCI_AT_GENERAL_BONDING;

 	conn->power_save = 1;
 	conn->disc_timeout = HCI_DISCONN_TIMEOUT;
-- 
1.6.0.4

Regards,
Andrei

On Wed, Jun 17, 2009 at 3:03 PM, Andrei
Emeltchenko<andrei.emeltchenko.news@gmail.com> wrote:
> Hi,
>
> We have error with SSP paring. Originally we could not connect some
> devices and the problem was reproduced on my PC with 2 USB Bluetooth
> adapters.
>
> bluez asks user paring confirmation 2 times.
>
> Test:
>
> hci1:   Type: USB
>        BD Address: 00:02:72:16:4E:D5 ACL MTU: 1021:8 SCO MTU: 64:1
>        UP RUNNING PSCAN
>        RX bytes:12122 acl:78 sco:0 events:449 errors:0
>        TX bytes:22547 acl:82 sco:0 commands:294 errors:0
>
> hci2:   Type: USB
>        BD Address: 00:02:72:16:19:39 ACL MTU: 1021:8 SCO MTU: 64:1
>        UP RUNNING PSCAN
>        RX bytes:12593 acl:82 sco:0 events:475 errors:0
>        TX bytes:28404 acl:78 sco:0 commands:329 errors:0
>
>
> hci1:
> sudo ./l2test -i hci1 -r -E -S   # server
>
> hci2:
> sudo ./l2test -i hci2 -n 00:02:72:16:4E:D5 -b 10 -N 1 -E -S -s   # client
>
>  ./simple-agent hci1
> Agent registered
> RequestConfirmation (/org/bluez/6255/hci1/dev_00_02_72_16_19_39, 533464)
> Confirm passkey (yes/no): yes
> RequestConfirmation (/org/bluez/6255/hci1/dev_00_02_72_16_19_39, 152200)
> Confirm passkey (yes/no): yes
>
>
> ./simple-agent hci2
> Agent registered
> RequestConfirmation (/org/bluez/6255/hci2/dev_00_02_72_16_4E_D5, 533464)
> Confirm passkey (yes/no): yes
> RequestConfirmation (/org/bluez/6255/hci2/dev_00_02_72_16_4E_D5, 152200)
> Confirm passkey (yes/no): yes
>
> For the single connection passkey is asked 2 times.
>
> The reason looks to be because bluetoothd does not store link keys
> since ioctl  HCIGETAUTHINFO returns 0.
> Kernel in function hci_get_auth_info returns "conn->auth_type" which
> is 0 at this stage. As I understood
> "auth_type" initialized later when "l2cap_connect_req" comes in
> "l2cap_check_security".
>
> What is the best way to solv this? In kernel or in user-space? Is it an error?
>
> Regards,
> Andrei
>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-07-02 13:57 [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING Andrei Emeltchenko
@ 2009-08-14 13:44 ` Andrei Emeltchenko
  2009-09-02  9:50 ` Marcel Holtmann
  1 sibling, 0 replies; 7+ messages in thread
From: Andrei Emeltchenko @ 2009-08-14 13:44 UTC (permalink / raw)
  To: linux-bluetooth

Hi Marcel,

Could you check the patch below? We found that it helps with Vista
initiated BT 2.1 paring as well.

Regards,
Andrei


On Thu, Jul 2, 2009 at 4:57 PM, Andrei
Emeltchenko<andrei.emeltchenko.news@gmail.com> wrote:
> Hi,
> I have a simple patch which fixes issues with SSP mentioned below.
>
> ---
>  net/bluetooth/hci_conn.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index fa47d5d..d863bda 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev
> *hdev, int type, bdaddr_t *dst)
>        conn->type  = type;
>        conn->mode  = HCI_CM_ACTIVE;
>        conn->state = BT_OPEN;
> +       conn->auth_type = HCI_AT_GENERAL_BONDING;
>
>        conn->power_save = 1;
>        conn->disc_timeout = HCI_DISCONN_TIMEOUT;
> --
> 1.6.0.4
>
> Regards,
> Andrei
>
> On Wed, Jun 17, 2009 at 3:03 PM, Andrei
> Emeltchenko<andrei.emeltchenko.news@gmail.com> wrote:
>> Hi,
>>
>> We have error with SSP paring. Originally we could not connect some
>> devices and the problem was reproduced on my PC with 2 USB Bluetooth
>> adapters.
>>
>> bluez asks user paring confirmation 2 times.
>>
>> Test:
>>
>> hci1:   Type: USB
>>        BD Address: 00:02:72:16:4E:D5 ACL MTU: 1021:8 SCO MTU: 64:1
>>        UP RUNNING PSCAN
>>        RX bytes:12122 acl:78 sco:0 events:449 errors:0
>>        TX bytes:22547 acl:82 sco:0 commands:294 errors:0
>>
>> hci2:   Type: USB
>>        BD Address: 00:02:72:16:19:39 ACL MTU: 1021:8 SCO MTU: 64:1
>>        UP RUNNING PSCAN
>>        RX bytes:12593 acl:82 sco:0 events:475 errors:0
>>        TX bytes:28404 acl:78 sco:0 commands:329 errors:0
>>
>>
>> hci1:
>> sudo ./l2test -i hci1 -r -E -S   # server
>>
>> hci2:
>> sudo ./l2test -i hci2 -n 00:02:72:16:4E:D5 -b 10 -N 1 -E -S -s   # client
>>
>>  ./simple-agent hci1
>> Agent registered
>> RequestConfirmation (/org/bluez/6255/hci1/dev_00_02_72_16_19_39, 533464)
>> Confirm passkey (yes/no): yes
>> RequestConfirmation (/org/bluez/6255/hci1/dev_00_02_72_16_19_39, 152200)
>> Confirm passkey (yes/no): yes
>>
>>
>> ./simple-agent hci2
>> Agent registered
>> RequestConfirmation (/org/bluez/6255/hci2/dev_00_02_72_16_4E_D5, 533464)
>> Confirm passkey (yes/no): yes
>> RequestConfirmation (/org/bluez/6255/hci2/dev_00_02_72_16_4E_D5, 152200)
>> Confirm passkey (yes/no): yes
>>
>> For the single connection passkey is asked 2 times.
>>
>> The reason looks to be because bluetoothd does not store link keys
>> since ioctl  HCIGETAUTHINFO returns 0.
>> Kernel in function hci_get_auth_info returns "conn->auth_type" which
>> is 0 at this stage. As I understood
>> "auth_type" initialized later when "l2cap_connect_req" comes in
>> "l2cap_check_security".
>>
>> What is the best way to solv this? In kernel or in user-space? Is it an error?
>>
>> Regards,
>> Andrei
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-07-02 13:57 [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING Andrei Emeltchenko
  2009-08-14 13:44 ` Andrei Emeltchenko
@ 2009-09-02  9:50 ` Marcel Holtmann
  2009-09-03  9:55   ` Andrei Emeltchenko
  1 sibling, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2009-09-02  9:50 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> I have a simple patch which fixes issues with SSP mentioned below.
> 
> ---
>  net/bluetooth/hci_conn.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index fa47d5d..d863bda 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev
> *hdev, int type, bdaddr_t *dst)
>  	conn->type  = type;
>  	conn->mode  = HCI_CM_ACTIVE;
>  	conn->state = BT_OPEN;
> +	conn->auth_type = HCI_AT_GENERAL_BONDING;
> 
>  	conn->power_save = 1;
>  	conn->disc_timeout = HCI_DISCONN_TIMEOUT;

I need a proper patch create with git format-patch that contains a
detailed commit message.

Regards

Marcel



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-09-02  9:50 ` Marcel Holtmann
@ 2009-09-03  9:55   ` Andrei Emeltchenko
  2009-09-09  7:43     ` Andrei Emeltchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Andrei Emeltchenko @ 2009-09-03  9:55 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

Hi Marcel,

On Wed, Sep 2, 2009 at 12:50 PM, Marcel Holtmann<marcel@holtmann.org> wrote:
> Hi Andrei,
>
>> I have a simple patch which fixes issues with SSP mentioned below.
>>
>> ---
>>  net/bluetooth/hci_conn.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
>> index fa47d5d..d863bda 100644
>> --- a/net/bluetooth/hci_conn.c
>> +++ b/net/bluetooth/hci_conn.c
>> @@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev
>> *hdev, int type, bdaddr_t *dst)
>>       conn->type  = type;
>>       conn->mode  = HCI_CM_ACTIVE;
>>       conn->state = BT_OPEN;
>> +     conn->auth_type = HCI_AT_GENERAL_BONDING;
>>
>>       conn->power_save = 1;
>>       conn->disc_timeout = HCI_DISCONN_TIMEOUT;
>
> I need a proper patch create with git format-patch that contains a
> detailed commit message.

Please check patch attached.

Regards,
Andrei

[-- Attachment #2: 0001-Bluetooth-Set-general-bonding-security-for-ACL-by-d.patch.gz --]
[-- Type: application/x-gzip, Size: 813 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-09-03  9:55   ` Andrei Emeltchenko
@ 2009-09-09  7:43     ` Andrei Emeltchenko
  2009-11-03  8:05       ` Andrei Emeltchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Andrei Emeltchenko @ 2009-09-09  7:43 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

>> I need a proper patch create with git format-patch that contains a
>> detailed commit message.
>
> Please check patch attached.

Have you had time to check the patch?

Regards,
Andrei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-09-09  7:43     ` Andrei Emeltchenko
@ 2009-11-03  8:05       ` Andrei Emeltchenko
  2009-11-03  8:41         ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Andrei Emeltchenko @ 2009-11-03  8:05 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

I have heard that you have tested this patch. Will it be finally
applied? Do I need to change commit message? If you find that message
does not represent patch good enough can you change it yourself?

Regards,
Andrei

On Wed, Sep 9, 2009 at 9:43 AM, Andrei Emeltchenko
<andrei.emeltchenko.news@gmail.com> wrote:
> Hi Marcel,
>
>>> I need a proper patch create with git format-patch that contains a
>>> detailed commit message.
>>
>> Please check patch attached.
>
> Have you had time to check the patch?
>
> Regards,
> Andrei
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING
  2009-11-03  8:05       ` Andrei Emeltchenko
@ 2009-11-03  8:41         ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2009-11-03  8:41 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

same warning as for everybody else. NO top posting.

> I have heard that you have tested this patch. Will it be finally
> applied? Do I need to change commit message? If you find that message
> does not represent patch good enough can you change it yourself?

I am in the process of creating a repository for Dave to pull from and
yes that patch will be part of it.

Regards

Marcel



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-03  8:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 13:57 [PATCH] SSP double paring fix: init auth_type with HCI_AT_GENERAL_BONDING Andrei Emeltchenko
2009-08-14 13:44 ` Andrei Emeltchenko
2009-09-02  9:50 ` Marcel Holtmann
2009-09-03  9:55   ` Andrei Emeltchenko
2009-09-09  7:43     ` Andrei Emeltchenko
2009-11-03  8:05       ` Andrei Emeltchenko
2009-11-03  8:41         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox