summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-19 14:57:47 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-02-19 08:04:24 -0800
commit35d702719d6464a9de2bf98d536c6e054f0a8f7e (patch)
tree483c5f9215f710855f062cc10e6d5b3835a1da71 /net/bluetooth/hci_core.c
parent23d0e128e38049734c7ecc0987de02486d1ded3e (diff)
downloadlinux-35d702719d6464a9de2bf98d536c6e054f0a8f7e.tar.bz2
Bluetooth: Move SMP LTK notification after key distribution
This patch moves the SMP Long Term Key notification over mgmt from the hci_add_ltk function to smp.c when both sides have completed their key distribution. This way we are also able to update the identity address into the mgmt_new_ltk event. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 60c875267c19..3711c7626cb2 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2762,9 +2762,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
}
struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
- u8 addr_type, u8 type, int new_key,
- u8 authenticated, u8 tk[16], u8 enc_size,
- __le16 ediv, u8 rand[8])
+ u8 addr_type, u8 type, u8 authenticated,
+ u8 tk[16], u8 enc_size, __le16 ediv, u8 rand[8])
{
struct smp_ltk *key, *old_key;
bool master = ltk_type_master(type);
@@ -2788,12 +2787,6 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
key->type = type;
memcpy(key->rand, rand, sizeof(key->rand));
- if (!new_key)
- return key;
-
- if (type == HCI_SMP_LTK || type == HCI_SMP_LTK_SLAVE)
- mgmt_new_ltk(hdev, key);
-
return key;
}