|
@@ -2183,6 +2183,18 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
|
if (!ev->status)
|
|
if (!ev->status)
|
|
conn->state = BT_CONNECTED;
|
|
conn->state = BT_CONNECTED;
|
|
|
|
|
|
|
|
+ /* In Secure Connections Only mode, do not allow any
|
|
|
|
+ * connections that are not encrypted with AES-CCM
|
|
|
|
+ * using a P-256 authenticated combination key.
|
|
|
|
+ */
|
|
|
|
+ if (test_bit(HCI_SC_ONLY, &hdev->dev_flags) &&
|
|
|
|
+ (!test_bit(HCI_CONN_AES_CCM, &conn->flags) ||
|
|
|
|
+ conn->key_type != HCI_LK_AUTH_COMBINATION_P256)) {
|
|
|
|
+ hci_proto_connect_cfm(conn, HCI_ERROR_AUTH_FAILURE);
|
|
|
|
+ hci_conn_drop(conn);
|
|
|
|
+ goto unlock;
|
|
|
|
+ }
|
|
|
|
+
|
|
hci_proto_connect_cfm(conn, ev->status);
|
|
hci_proto_connect_cfm(conn, ev->status);
|
|
hci_conn_drop(conn);
|
|
hci_conn_drop(conn);
|
|
} else
|
|
} else
|