diff options
-rw-r--r-- | net/bluetooth/mgmt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 25e40e82b9a2..8417ab387d1a 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -131,6 +131,9 @@ static const u16 mgmt_events[] = { | |||
131 | 131 | ||
132 | #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) | 132 | #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) |
133 | 133 | ||
134 | #define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \ | ||
135 | "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
136 | |||
134 | struct pending_cmd { | 137 | struct pending_cmd { |
135 | struct list_head list; | 138 | struct list_head list; |
136 | u16 opcode; | 139 | u16 opcode; |
@@ -3673,6 +3676,18 @@ static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, | |||
3673 | u8 status; | 3676 | u8 status; |
3674 | 3677 | ||
3675 | if (bdaddr_type_is_le(cp->addr.type)) { | 3678 | if (bdaddr_type_is_le(cp->addr.type)) { |
3679 | /* Enforce zero-valued 192-bit parameters as | ||
3680 | * long as legacy SMP OOB isn't implemented. | ||
3681 | */ | ||
3682 | if (memcmp(cp->rand192, ZERO_KEY, 16) || | ||
3683 | memcmp(cp->hash192, ZERO_KEY, 16)) { | ||
3684 | err = cmd_complete(sk, hdev->id, | ||
3685 | MGMT_OP_ADD_REMOTE_OOB_DATA, | ||
3686 | MGMT_STATUS_INVALID_PARAMS, | ||
3687 | addr, sizeof(*addr)); | ||
3688 | goto unlock; | ||
3689 | } | ||
3690 | |||
3676 | rand192 = NULL; | 3691 | rand192 = NULL; |
3677 | hash192 = NULL; | 3692 | hash192 = NULL; |
3678 | } else { | 3693 | } else { |