diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2011-07-07 17:59:35 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-07-08 16:36:25 -0400 |
commit | 34918cd71b953905e5f832537ead436bcd57e8f9 (patch) | |
tree | 31cbaab1498c94143cec71a328930361987d08a1 /include/net | |
parent | 7034b911af1aa571995b56db3ed71a25daf00373 (diff) |
Bluetooth: Add new structures for supporting SM key distribution
We need these changes because SMP keys may have more information
associated with them, for example, in the LTK case, it has an
encrypted diversifier (ediv) and a random number (rand).
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci.h | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 16 | ||||
-rw-r--r-- | include/net/bluetooth/mgmt.h | 2 |
3 files changed, 22 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 5004e36d0a66..be30aabe7b88 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -259,6 +259,10 @@ enum { | |||
259 | #define HCI_LK_UNAUTH_COMBINATION 0x04 | 259 | #define HCI_LK_UNAUTH_COMBINATION 0x04 |
260 | #define HCI_LK_AUTH_COMBINATION 0x05 | 260 | #define HCI_LK_AUTH_COMBINATION 0x05 |
261 | #define HCI_LK_CHANGED_COMBINATION 0x06 | 261 | #define HCI_LK_CHANGED_COMBINATION 0x06 |
262 | /* The spec doesn't define types for SMP keys */ | ||
263 | #define HCI_LK_SMP_LTK 0x81 | ||
264 | #define HCI_LK_SMP_IRK 0x82 | ||
265 | #define HCI_LK_SMP_CSRK 0x83 | ||
262 | 266 | ||
263 | /* ----- HCI Commands ---- */ | 267 | /* ----- HCI Commands ---- */ |
264 | #define HCI_OP_NOP 0x0000 | 268 | #define HCI_OP_NOP 0x0000 |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index bb57bcadf484..0e1fd2b29b0a 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -74,12 +74,28 @@ struct bt_uuid { | |||
74 | u8 svc_hint; | 74 | u8 svc_hint; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | struct key_master_id { | ||
78 | __le16 ediv; | ||
79 | u8 rand[8]; | ||
80 | } __packed; | ||
81 | |||
82 | struct link_key_data { | ||
83 | bdaddr_t bdaddr; | ||
84 | u8 type; | ||
85 | u8 val[16]; | ||
86 | u8 pin_len; | ||
87 | u8 dlen; | ||
88 | u8 data[0]; | ||
89 | } __packed; | ||
90 | |||
77 | struct link_key { | 91 | struct link_key { |
78 | struct list_head list; | 92 | struct list_head list; |
79 | bdaddr_t bdaddr; | 93 | bdaddr_t bdaddr; |
80 | u8 type; | 94 | u8 type; |
81 | u8 val[16]; | 95 | u8 val[16]; |
82 | u8 pin_len; | 96 | u8 pin_len; |
97 | u8 dlen; | ||
98 | u8 data[0]; | ||
83 | }; | 99 | }; |
84 | 100 | ||
85 | struct oob_data { | 101 | struct oob_data { |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 45bea25d737f..5428fd32ccec 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -101,6 +101,8 @@ struct mgmt_key_info { | |||
101 | u8 type; | 101 | u8 type; |
102 | u8 val[16]; | 102 | u8 val[16]; |
103 | u8 pin_len; | 103 | u8 pin_len; |
104 | u8 dlen; | ||
105 | u8 data[0]; | ||
104 | } __packed; | 106 | } __packed; |
105 | 107 | ||
106 | #define MGMT_OP_LOAD_KEYS 0x000D | 108 | #define MGMT_OP_LOAD_KEYS 0x000D |