diff options
-rw-r--r-- | net/bluetooth/hci_event.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 8ed8516b18c7..00c160634e7b 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -36,6 +36,9 @@ | |||
36 | #include "amp.h" | 36 | #include "amp.h" |
37 | #include "smp.h" | 37 | #include "smp.h" |
38 | 38 | ||
39 | #define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \ | ||
40 | "\x00\x00\x00\x00\x00\x00\x00\x00" | ||
41 | |||
39 | /* Handle HCI Event packets */ | 42 | /* Handle HCI Event packets */ |
40 | 43 | ||
41 | static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) | 44 | static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) |
@@ -3864,6 +3867,16 @@ static u8 bredr_oob_data_present(struct hci_conn *conn) | |||
3864 | if (!data) | 3867 | if (!data) |
3865 | return 0x00; | 3868 | return 0x00; |
3866 | 3869 | ||
3870 | /* When Secure Connections Only mode is enabled, then the P-256 | ||
3871 | * values are required. If they are not available, then do not | ||
3872 | * declare that OOB data is present. | ||
3873 | */ | ||
3874 | if (bredr_sc_enabled(hdev) && | ||
3875 | test_bit(HCI_SC_ONLY, &hdev->dev_flags) && | ||
3876 | (!memcmp(data->rand256, ZERO_KEY, 16) || | ||
3877 | !memcmp(data->hash256, ZERO_KEY, 16))) | ||
3878 | return 0x00; | ||
3879 | |||
3867 | if (conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)) | 3880 | if (conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)) |
3868 | return 0x01; | 3881 | return 0x01; |
3869 | 3882 | ||