aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci_core.h
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2012-02-02 19:08:00 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:32 -0500
commitb899efaf9b26cadb084752862490b4fc44bc3169 (patch)
treef0fc1dae801b98ae8b525798a48c292cfaf15329 /include/net/bluetooth/hci_core.h
parent650f726d16a3f25153d785b531516f6e90d2014f (diff)
Bluetooth: Add new structures for handling SMP Long Term Keys
This includes a new list for storing the keys and a new structure used to represent each key. Some notes: authenticated is used to identify that the key may be used to setup a HIGH security link. As the same list is used to store both the STK's and the LTK's the type field is used so we can separate between those two types of keys and if the key should be used when in the master or slave role. 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 'include/net/bluetooth/hci_core.h')
-rw-r--r--include/net/bluetooth/hci_core.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 896d9e4955fc..c998176a503d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -88,6 +88,18 @@ struct bt_uuid {
88 u8 svc_hint; 88 u8 svc_hint;
89}; 89};
90 90
91struct smp_ltk {
92 struct list_head list;
93 bdaddr_t bdaddr;
94 u8 bdaddr_type;
95 u8 authenticated;
96 u8 type;
97 u8 enc_size;
98 __le16 ediv;
99 u8 rand[8];
100 u8 val[16];
101} __packed;
102
91struct key_master_id { 103struct key_master_id {
92 __le16 ediv; 104 __le16 ediv;
93 u8 rand[8]; 105 u8 rand[8];
@@ -239,6 +251,8 @@ struct hci_dev {
239 251
240 struct list_head link_keys; 252 struct list_head link_keys;
241 253
254 struct list_head long_term_keys;
255
242 struct list_head remote_oob_data; 256 struct list_head remote_oob_data;
243 257
244 struct list_head adv_entries; 258 struct list_head adv_entries;
@@ -647,8 +661,10 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
647struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); 661struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]);
648struct link_key *hci_find_link_key_type(struct hci_dev *hdev, 662struct link_key *hci_find_link_key_type(struct hci_dev *hdev,
649 bdaddr_t *bdaddr, u8 type); 663 bdaddr_t *bdaddr, u8 type);
664int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr);
650int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr, 665int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
651 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]); 666 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]);
667int hci_smp_ltks_clear(struct hci_dev *hdev);
652int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 668int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
653 669
654int hci_remote_oob_data_clear(struct hci_dev *hdev); 670int hci_remote_oob_data_clear(struct hci_dev *hdev);