diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-27 19:04:33 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-01-28 15:26:21 -0500 |
commit | aa5b03456500b57ab30313affa822d4cd90e2ab2 (patch) | |
tree | b76f4ced72a0eadceac228a29446f983b28479c4 /net/bluetooth | |
parent | a83ed81ef5881445d96120bea2032f72884fe038 (diff) |
Bluetooth: Check for P-256 OOB values in Secure Connections Only mode
If Secure Connections Only mode has been enabled, the it is important
to check that OOB data for P-256 values is provided. In case it is not,
then tell the remote side that no OOB data is present.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-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 | ||