diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 15d1cb5aee18d..034a5ec746248 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1272,8 +1272,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;