Bluetooth: Check key sizes only when Secure Simple Pairing is enabled
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 22 May 2019 07:05:40 +0000 (09:05 +0200)
committerPhil Elwell <phil@raspberrypi.org>
Fri, 24 May 2019 08:21:29 +0000 (09:21 +0100)
commit00de9e45fe619d9fd3e810d10d99ac328ee5190c
tree99e0310ea363cd40bdea889195aa35603f2cd0e1
parentb45a32b47b76cb64225d19841c20ee85ea97874d
Bluetooth: Check key sizes only when Secure Simple Pairing is enabled

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