Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.

MGMT command is added to receive the list of blocked keys from
user-space.

The list is used to:
1) Block keys from being distributed by the device during
   the ke distribution phase of SMP.
2) Filter out any keys that were previously saved so
   they are no longer used.

Signed-off-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Alain Michaud
2020-01-07 00:43:17 +00:00
committed by Marcel Holtmann
parent 5e6d8401ad
commit 600a87490f
6 changed files with 215 additions and 8 deletions

View File

@@ -654,6 +654,23 @@ struct mgmt_cp_set_phy_confguration {
} __packed;
#define MGMT_SET_PHY_CONFIGURATION_SIZE 4
#define MGMT_OP_SET_BLOCKED_KEYS 0x0046
#define HCI_BLOCKED_KEY_TYPE_LINKKEY 0x00
#define HCI_BLOCKED_KEY_TYPE_LTK 0x01
#define HCI_BLOCKED_KEY_TYPE_IRK 0x02
struct mgmt_blocked_key_info {
__u8 type;
__u8 val[16];
} __packed;
struct mgmt_cp_set_blocked_keys {
__le16 key_count;
struct mgmt_blocked_key_info keys[0];
} __packed;
#define MGMT_OP_SET_BLOCKED_KEYS_SIZE 2
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;