[Pkg-bluetooth-maintainers] Bug#384680: bluez-utils: cannot enable authentication by a PIN

Géraud Meyer geraud_meyer at hotmail.com
Sun Aug 27 12:06:05 UTC 2006


I suspect I did not state my problem clearly.

> /etc/bluetooth/passkeys/default must contain a single string which is the
> default outgoing pin.
> the passkey option in hcid.conf is for incoming connections.
> after modifying those files you must /etc/init.d/bluetooth stop and
> /etc/init.d/bluetooth start

I knew all that. I am able to connect 2 computers but I want to make sure that the PIN
authentication works. That's why I want to see the connection fail if the PINs are different.
My problem is that the connection is successful even when the PINs of
/etc/bluetooth/passkeys/default and hcid.conf are identical on a certain computer and when
these 2 PINs of one computer are different from the ones of the other computer.
I have already stopped and restarted the bluetooth service and the authentication should thus
fail, so the PIN authentication is in fact not enabled whereas I wish it was.

The only logs I found showing a pin request are those of failed  connections (the problem in this log was
mentioned in a bug report but what is strange to me is that the previous connections didn't mention
the pin request). Here is an example:

Aug 19 02:06:24 localhost hcid[21302]: Bluetooth HCI daemon
Aug 19 02:06:24 localhost hcid[21302]: Register path:/org/bluez fallback:1
Aug 19 02:06:24 localhost hcid[21302]: Device hci0 has been added
Aug 19 02:06:24 localhost sdpd[21305]: Bluetooth SDP daemon
Aug 19 02:06:24 localhost hcid[21302]: Can't write inquiry mode for hci0: Input/output error (5)
Aug 19 02:06:24 localhost hcid[21302]: Register path:/org/bluez/hci0 fallback:0
Aug 19 02:06:24 localhost hcid[21302]: HCI dev 0 up
Aug 19 02:06:24 localhost hcid[21302]: Starting security manager 0
Aug 19 02:06:24 localhost hcid[21302]: Can't write inquiry mode for hci0: Input/output error (5)
Aug 19 02:06:24 localhost hcid[21302]: return_link_keys (sba=00:0B:0D:20:E7:40, dba=00:00:00:00:00:00)
Aug 19 02:06:24 localhost hcid[21302]: return_link_keys (sba=00:0B:0D:20:E7:40, dba=00:00:00:00:00:00)
Aug 19 02:06:24 localhost pand[21430]: Bluetooth PAN daemon version 3.1
Aug 19 02:06:24 localhost pand[21430]: Connecting to 00:0A:3A:6C:E5:25
Aug 19 02:06:24 localhost hcid[21302]: pin_code_request (sba=00:0B:0D:20:E7:40, dba=00:0A:3A:6C:E5:25)
Aug 19 02:06:24 localhost hcid[21302]: call_passkey_agent(): no agent registered
Aug 19 02:06:25 localhost pand[21430]: Connect to 00:0A:3A:6C:E5:25 failed. Permission denied(13)

Here is what happens now, so you can check that everything that should be is running. These are the processes on machine A:

# /etc/init.d/bluetooth start
Starting bluetooth: hcid sdpd sdp_options rfcomm pan0 pand.
# ps ax
...
 4990 ?        S<     0:00 [krfcommd]
 5393 ?        Ss     0:00 /usr/sbin/hcid
 5395 ?        Ss     0:00 /usr/sbin/sdpd
 5494 ?        Ss     0:00 /usr/bin/pand --listen --role NAP --devup /etc/bluetooth/pan/dev-up --auth --encrypt
 5498 pts/0    S      0:00 /usr/lib/bluetooth/add-passkey --default

On machine B:
# /etc/init.d/bluetooth start
Starting bluetooth: hcid sdpd sdp_options rfcomm.
# ps ax
...
 8859 ?        S<     0:00 [krfcommd]
16079 ?        Ss     0:00 /usr/sbin/hcid
16082 ?        Ss     0:00 /usr/sbin/sdpd
16089 pts/1    S      0:00 /usr/lib/bluetooth/add-passkey --default
# pand --connect 00:0A:3A:6C:E5:25 --role NAPU --devup /etc/bluetooth/pan/dev-up --auth --encrypt
# cat /var/log/daemon.log
...
Aug 27 13:32:55 localhost hcid[16079]: Bluetooth HCI daemon
Aug 27 13:32:55 localhost hcid[16079]: Register path:/org/bluez fallback:1
Aug 27 13:32:55 localhost hcid[16079]: Device hci0 has been added
Aug 27 13:32:55 localhost sdpd[16082]: Bluetooth SDP daemon
Aug 27 13:32:55 localhost hcid[16079]: Can't write inquiry mode for hci0: Input/output error (5)
Aug 27 13:32:55 localhost hcid[16079]: Register path:/org/bluez/hci0 fallback:0
Aug 27 13:32:56 localhost hcid[16079]: HCI dev 0 up
Aug 27 13:32:56 localhost hcid[16079]: Starting security manager 0
Aug 27 13:32:56 localhost hcid[16079]: Can't write inquiry mode for hci0: Input/output error (5)
Aug 27 13:32:56 localhost hcid[16079]: name_listener_add(:1.59)
Aug 27 13:32:56 localhost hcid[16079]: Default passkey agent (:1.59, /org/bluez/passkey_agent_16089) registered
Aug 27 13:32:56 localhost hcid[16079]: return_link_keys (sba=00:0B:0D:20:E7:40, dba=00:00:00:00:00:00)
Aug 27 13:32:56 localhost hcid[16079]: return_link_keys (sba=00:0B:0D:20:E7:40, dba=00:00:00:00:00:00)
Aug 27 13:33:13 localhost pand[16096]: Bluetooth PAN daemon version 3.1
Aug 27 13:33:13 localhost pand[16096]: Connecting to 00:0A:3A:6C:E5:25
Aug 27 13:33:14 localhost hcid[16079]: link_key_request (sba=00:0B:0D:20:E7:40, dba=00:0A:3A:6C:E5:25)
Aug 27 13:33:14 localhost pand[16096]: bnep0 connected

On machine A:
# cat /var/log/daemon.log
...
Aug 27 13:15:54 localhost hcid[5393]: Bluetooth HCI daemon
Aug 27 13:15:54 localhost sdpd[5395]: Bluetooth SDP daemon
Aug 27 13:15:54 localhost hcid[5393]: Register path:/org/bluez fallback:1
Aug 27 13:15:54 localhost hcid[5393]: Device hci0 has been added
Aug 27 13:15:54 localhost hcid[5393]: Starting security manager 0
Aug 27 13:15:54 localhost hcid[5393]: Device hci0 has been activated
Aug 27 13:15:54 localhost hcid[5393]: Register path:/org/bluez/hci0 fallback:0
Aug 27 13:15:54 localhost pand[5494]: Bluetooth PAN daemon version 3.1
Aug 27 13:15:54 localhost hcid[5393]: name_listener_add(:1.4)
Aug 27 13:15:54 localhost hcid[5393]: Default passkey agent (:1.4, /org/bluez/passkey_agent_5498) registered
Aug 27 13:16:48 localhost hcid[5393]: link_key_request (sba=00:0A:3A:6C:E5:25, dba=00:0B:0D:20:E7:40)
Aug 27 13:16:49 localhost pand[5504]: New connection from 00:0B:0D:20:E7:40 bnep%d

hcid used to make a PIN request. Is now pand to make a PIN request? I suppose so because the option `auth enable'
of hcid.conf is obsolete and because the undocumented pand option --auth seems to be new. But if it is not so,
then my problem is how do I tell hcid to enable PIN authentication now?






More information about the Pkg-bluetooth-maintainers mailing list