Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34918cd7 authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by Gustavo Padovan
Browse files

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: default avatarVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 7034b911
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -259,6 +259,10 @@ enum {
#define HCI_LK_UNAUTH_COMBINATION	0x04
#define HCI_LK_UNAUTH_COMBINATION	0x04
#define HCI_LK_AUTH_COMBINATION		0x05
#define HCI_LK_AUTH_COMBINATION		0x05
#define HCI_LK_CHANGED_COMBINATION	0x06
#define HCI_LK_CHANGED_COMBINATION	0x06
/* The spec doesn't define types for SMP keys */
#define HCI_LK_SMP_LTK			0x81
#define HCI_LK_SMP_IRK			0x82
#define HCI_LK_SMP_CSRK			0x83


/* -----  HCI Commands ---- */
/* -----  HCI Commands ---- */
#define HCI_OP_NOP			0x0000
#define HCI_OP_NOP			0x0000
+16 −0
Original line number Original line Diff line number Diff line
@@ -74,12 +74,28 @@ struct bt_uuid {
	u8 svc_hint;
	u8 svc_hint;
};
};


struct key_master_id {
	__le16 ediv;
	u8 rand[8];
} __packed;

struct link_key_data {
	bdaddr_t bdaddr;
	u8 type;
	u8 val[16];
	u8 pin_len;
	u8 dlen;
	u8 data[0];
} __packed;

struct link_key {
struct link_key {
	struct list_head list;
	struct list_head list;
	bdaddr_t bdaddr;
	bdaddr_t bdaddr;
	u8 type;
	u8 type;
	u8 val[16];
	u8 val[16];
	u8 pin_len;
	u8 pin_len;
	u8 dlen;
	u8 data[0];
};
};


struct oob_data {
struct oob_data {
+2 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,8 @@ struct mgmt_key_info {
	u8 type;
	u8 type;
	u8 val[16];
	u8 val[16];
	u8 pin_len;
	u8 pin_len;
	u8 dlen;
	u8 data[0];
} __packed;
} __packed;


#define MGMT_OP_LOAD_KEYS		0x000D
#define MGMT_OP_LOAD_KEYS		0x000D