From e136183fa06312d126c34c90ce725017f2ef8f90 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 6 Feb 2009 09:28:24 -0800 Subject: Don't changed combination keys for no-bonding --- src/dbus-hci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dbus-hci.c b/src/dbus-hci.c index ac44abe1..45f65f1d 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -917,8 +917,11 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer, /* Only store the link key if neither side had "no bonding" as a * requirement */ - if (key_type == 0x06 || (local_auth > 0x01 && remote_auth > 0x01)) { - int err = write_link_key(local, peer, key, new_key_type, pin_length); + if ((key_type == 0x06 && old_key_type != 0xff) || + (local_auth > 0x01 && remote_auth > 0x01)) { + int err; + + err = write_link_key(local, peer, key, new_key_type, pin_length); if (err < 0) { error("write_link_key: %s (%d)", strerror(-err), -err); return err; -- cgit