mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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:
committed by
Marcel Holtmann
parent
5e6d8401ad
commit
600a87490f
@@ -2453,6 +2453,15 @@ static int smp_cmd_encrypt_info(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
if (skb->len < sizeof(*rp))
|
||||
return SMP_INVALID_PARAMS;
|
||||
|
||||
/* Pairing is aborted if any blocked keys are distributed */
|
||||
if (hci_is_blocked_key(conn->hcon->hdev, HCI_BLOCKED_KEY_TYPE_LTK,
|
||||
rp->ltk)) {
|
||||
bt_dev_warn_ratelimited(conn->hcon->hdev,
|
||||
"LTK blocked for %pMR",
|
||||
&conn->hcon->dst);
|
||||
return SMP_INVALID_PARAMS;
|
||||
}
|
||||
|
||||
SMP_ALLOW_CMD(smp, SMP_CMD_MASTER_IDENT);
|
||||
|
||||
skb_pull(skb, sizeof(*rp));
|
||||
@@ -2509,6 +2518,15 @@ static int smp_cmd_ident_info(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
if (skb->len < sizeof(*info))
|
||||
return SMP_INVALID_PARAMS;
|
||||
|
||||
/* Pairing is aborted if any blocked keys are distributed */
|
||||
if (hci_is_blocked_key(conn->hcon->hdev, HCI_BLOCKED_KEY_TYPE_IRK,
|
||||
info->irk)) {
|
||||
bt_dev_warn_ratelimited(conn->hcon->hdev,
|
||||
"Identity key blocked for %pMR",
|
||||
&conn->hcon->dst);
|
||||
return SMP_INVALID_PARAMS;
|
||||
}
|
||||
|
||||
SMP_ALLOW_CMD(smp, SMP_CMD_IDENT_ADDR_INFO);
|
||||
|
||||
skb_pull(skb, sizeof(*info));
|
||||
|
Reference in New Issue
Block a user