diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2012-02-02 19:08:00 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:32 -0500 |
commit | b899efaf9b26cadb084752862490b4fc44bc3169 (patch) | |
tree | f0fc1dae801b98ae8b525798a48c292cfaf15329 /include/net/bluetooth/hci_core.h | |
parent | 650f726d16a3f25153d785b531516f6e90d2014f (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.h | 16 |
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 | ||
91 | struct 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 | |||
91 | struct key_master_id { | 103 | struct 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, | |||
647 | struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); | 661 | struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); |
648 | struct link_key *hci_find_link_key_type(struct hci_dev *hdev, | 662 | struct link_key *hci_find_link_key_type(struct hci_dev *hdev, |
649 | bdaddr_t *bdaddr, u8 type); | 663 | bdaddr_t *bdaddr, u8 type); |
664 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
650 | int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr, | 665 | int 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]); |
667 | int hci_smp_ltks_clear(struct hci_dev *hdev); | ||
652 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 668 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
653 | 669 | ||
654 | int hci_remote_oob_data_clear(struct hci_dev *hdev); | 670 | int hci_remote_oob_data_clear(struct hci_dev *hdev); |