summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-02-12 15:57:55 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-02-12 15:57:55 +0100
commitd31f1f9fb937038e92e3c2228d3d4cda934cefa0 (patch)
treee0c4a0de7f4886d18e84ece09bd1bb5afe95106d /src
parentf8c2a96432a78aab515e7b4f3cd044f53946d908 (diff)
If remote side initiates dedicated bonding follow it and store the key
Diffstat (limited to 'src')
-rw-r--r--src/dbus-hci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 72e691bd..ff89043f 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -917,6 +917,9 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
get_auth_requirements(local, peer, &local_auth);
remote_auth = device_get_auth(device);
+ debug("local auth 0x%02x and remote auth 0x%02x",
+ local_auth, remote_auth);
+
/* Only store the link key if one of the following is true:
* 1. this is a legacy link key
* 2. this is a changed combination key and there was a previously
@@ -926,9 +929,12 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
*/
if (key_type < 0x03 || (key_type == 0x06 && old_key_type != 0xff) ||
(local_auth > 0x01 && remote_auth > 0x01) ||
- (local_auth == 0x02 || local_auth == 0x03)) {
+ (local_auth == 0x02 || local_auth == 0x03) ||
+ (remote_auth == 0x02 || remote_auth == 0x03)) {
int err;
+ debug("storing link key of type 0x%02x", key_type);
+
err = write_link_key(local, peer, key, new_key_type,
pin_length);
if (err < 0) {