summary'>refs'>log'>treecommitdiff'>stats
path: '>root//'>sys-kernel/'>boest-v4.14.127//0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch
diff options
context:
space:
mode:
'>Diffstat (limited to 'sys-kernel/boest-v4.14.127/0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch')
--rw-r--r--'>sys-kernel/boest-v4.14.127/0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch3838
1 files changed, 38 insertions, 0 deletions
diff --git a/sys-kernel/boest-v4.14.127/0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch b/sys-kernel/boest-v4.14.127/0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch
new file mode 100644
index 00000000..d8c6ba56
--- /dev/null
+++ b/'>sys-kernel/boest-v4.14.127/0011-The-encryption-is-only-mandatory-to-be-enforced-when.patch
@@ -0,0 +1,38 @@
+From ec662bfba8dab231a6a90f0c65b720d066b94571 Mon Sep 17 00:00:00 2001
+From: Mike Pagano <mpagano@gentoo.org>
+Date: Tue, 11 Jun 2019 13:50:47 -0400
+Subject: [PATCH 11/19] The encryption is only mandatory to be enforced when
+ both sides are using Secure Simple Pairing and this means the key size check
+ makes only sense in that case.
+
+On legacy Bluetooth 2.0 and earlier devices like mice the encryption was
+optional and thus causing an issue if the key size check is not bound to
+using Secure Simple Pairing.
++
+Fixes: d5bb334a8e17 ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections")
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Cc: stable@vger.kernel.org
+---
+ net/bluetooth/hci_conn.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
+index cc061495f653..0415bf7edcc4 100644
+--- a/net/bluetooth/hci_conn.c
++++ b/net/bluetooth/hci_conn.c
+@@ -1161,8 +1161,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
+ return 0;
+ }
+ +
+- if (hci_conn_ssp_enabled(conn) &&
+- !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
++ /* If Secure Simple Pairing is not enabled, then legacy connection
++ * setup is used and no encryption or key sizes can be enforced.
++ */
++ if (!hci_conn_ssp_enabled(conn))
++ return 1;
++++
++ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+ return 0;
+
+ return 1;