aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2012-02-02 19:08:01 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:33 -0500
commitc9839a11c0e460a2457e7cac76650d07773e6c3b (patch)
tree053e815839a9dcc099bad50863acb63eed884857 /net/bluetooth/hci_event.c
parentb899efaf9b26cadb084752862490b4fc44bc3169 (diff)
Bluetooth: Use the updated key structures for handling LTKs
This updates all the users of the older way, that was using the link_keys list to store the SMP keys, to use the new way. This includes defining new types for the keys, we have a type for each combination of STK/LTK and Master/Slave. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a86f82b11316..23dbb31f0423 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3256,7 +3256,7 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
3256 struct hci_cp_le_ltk_reply cp; 3256 struct hci_cp_le_ltk_reply cp;
3257 struct hci_cp_le_ltk_neg_reply neg; 3257 struct hci_cp_le_ltk_neg_reply neg;
3258 struct hci_conn *conn; 3258 struct hci_conn *conn;
3259 struct link_key *ltk; 3259 struct smp_ltk *ltk;
3260 3260
3261 BT_DBG("%s handle %d", hdev->name, cpu_to_le16(ev->handle)); 3261 BT_DBG("%s handle %d", hdev->name, cpu_to_le16(ev->handle));
3262 3262
@@ -3272,10 +3272,17 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
3272 3272
3273 memcpy(cp.ltk, ltk->val, sizeof(ltk->val)); 3273 memcpy(cp.ltk, ltk->val, sizeof(ltk->val));
3274 cp.handle = cpu_to_le16(conn->handle); 3274 cp.handle = cpu_to_le16(conn->handle);
3275 conn->pin_length = ltk->pin_len; 3275
3276 if (ltk->authenticated)
3277 conn->sec_level = BT_SECURITY_HIGH;
3276 3278
3277 hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); 3279 hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
3278 3280
3281 if (ltk->type & HCI_SMP_STK) {
3282 list_del(&ltk->list);
3283 kfree(ltk);
3284 }
3285
3279 hci_dev_unlock(hdev); 3286 hci_dev_unlock(hdev);
3280 3287
3281 return; 3288 return;