Skip to contentSkip to conversation

bug link_key: no connection after AP was once accessed with Win XP AVM tools

Bluez-users Achim Bohnet 2 participants 3 messages Mar 30, 2004 – Mar 31, 2004 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,
to explore my AVM AP-X I once used WinXP. After rebooting into linux. ciptool was unable to connect to the AP. Fix/hack was to shutdown hcid, move /etc/bluetooth/link_key away and restart hcid. (I'm proud of this wild guess that fixed it ;)
Then I got a pin prompt again and everything started working again.

With the 'unusable-after-winxp-usage' link_key file I get

# ciptool connect 00:04:0E:85:34:F3
Can't connect L2CAP socket: Connection timed out
# hcidump -x gives:
HCIDump - HCI packet analyzer ver 1.5
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection(0x01|0x0005) plen 13
  F3 34 85 0E 04 00 18 CC 02 00 00 00 01
Quoted 1 line

HCI Event: Command Status(0x0f) plen 4

00 01 05 04

Quoted 1 line

HCI Event: Link Key Request(0x17) plen 6

F3 34 85 0E 04 00
< HCI Command: Link Key Request Reply(0x01|0x000b) plen 22
F3 34 85 0E 04 00 EE 90 55 76 1E 90 F2 DB 52 22 16 F7 5E 15 A7 F5

Quoted 1 line

HCI Event: Connect Complete(0x03) plen 11

05 00 00 F3 34 85 0E 04 00 01 00

I use debian testing with 2.6.4 and

ii  bluez-hcidump              1.5-2                      Analyses Bluetooth HCI packets
ii  bluez-pan                  1.1rel-3                   Personal area networking for Bluetooth devices
ii  bluez-pin                  0.22-1                     Bluetooth PIN helper with D-BUS support
ii  bluez-sdp                  1.5-2                      BlueZ Bluetooth SDP daemon and tool
ii  bluez-utils                2.4-6                      Utilities for controlling Bluetooth devices

Here's hcid.conf

allee(0) ~ $ tcgrep -v '^(\s*#|$)' /etc/bluetooth/hcid.conf

options {
        autoinit yes;
        security auto;
        pairing multi;
        pin_helper /usr/bin/bluepin.ach;
}
device {
        name "%h-%d";
        class 0x100;
        iscan enable; pscan enable;
        lm accept;
        lp rswitch,hold,sniff,park;
        auth enable;
        encrypt enable;
}
Signature · 15 lines
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- [email protected]


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
maintainer
#1 lore raw

Hi Achim,

Quoted 36 lines

to explore my AVM AP-X I once used WinXP. After rebooting into linux. ciptool was unable to connect to the AP. Fix/hack was to shutdown hcid, move /etc/bluetooth/link_key away and restart hcid. (I'm proud of this wild guess that fixed it ;)
Then I got a pin prompt again and everything started working again.

With the 'unusable-after-winxp-usage' link_key file I get

# ciptool connect 00:04:0E:85:34:F3
Can't connect L2CAP socket: Connection timed out
# hcidump -x gives:
HCIDump - HCI packet analyzer ver 1.5
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection(0x01|0x0005) plen 13
  F3 34 85 0E 04 00 18 CC 02 00 00 00 01
Quoted 1 line

HCI Event: Command Status(0x0f) plen 4

00 01 05 04

Quoted 1 line

HCI Event: Link Key Request(0x17) plen 6

F3 34 85 0E 04 00
< HCI Command: Link Key Request Reply(0x01|0x000b) plen 22
F3 34 85 0E 04 00 EE 90 55 76 1E 90 F2 DB 52 22 16 F7 5E 15 A7 F5

Quoted 1 line

HCI Event: Connect Complete(0x03) plen 11

05 00 00 F3 34 85 0E 04 00 01 00

I use debian testing with 2.6.4 and

ii  bluez-hcidump              1.5-2                      Analyses Bluetooth HCI packets
ii  bluez-pan                  1.1rel-3                   Personal area networking for Bluetooth devices
ii  bluez-pin                  0.22-1                     Bluetooth PIN helper with D-BUS support
ii  bluez-sdp                  1.5-2                      BlueZ Bluetooth SDP daemon and tool
ii  bluez-utils                2.4-6                      Utilities for controlling Bluetooth devices

Here's hcid.conf

allee(0) ~ $ tcgrep -v '^(\s*#|$)' /etc/bluetooth/hcid.conf

Quoted 15 lines
options {
        autoinit yes;
        security auto;
        pairing multi;
        pin_helper /usr/bin/bluepin.ach;
}
device {
        name "%h-%d";
        class 0x100;
        iscan enable; pscan enable;
        lm accept;
        lp rswitch,hold,sniff,park;
        auth enable;
        encrypt enable;
}

don't enable auth and encrypt, because this means security mode 3. Leave it off and let the AP trigger the security mechanism.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

Hi Achim,

Quoted 6 lines
Quoted 2 lines

don't enable auth and encrypt, because this means security mode 3. Leave it off and let the AP trigger the security mechanism.

Right, after commenting out auth and encrypt, stop hcid, reinstalling old 'borked' link_key file and starting hcid, ciptool asked for a pin.

Quoted 6 lines

Now I have two ways to workaround a bug, it is a bug isn't it? At least with auth and encrypt enabled and no link_key entry or a valid link_key entry, ciptool works. Only with an invalid link_key entry it fails. So for me, who never read any bluetooth spec (sorry), it looks like hcid fails to ask for a PIN is the case the link_key is no longer valid.

I already talked with the guys from AVM about the problem and this is part of the link manager of the local Bluetooth dongle. At the moment I am not quite sure what should be the right behaviour of a link manager in security mode 3 and a wrong link key. I will test other dongles if I have more time.

Quoted 2 lines

Thx, for ciptool and your bluetooth work Marcel, beside this trouble it served my needs always perfectly.

You are welcome.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users