Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba15a58b authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

Bluetooth: Fix SSP acceptor just-works confirmation without MITM



From the Bluetooth Core Specification 4.1 page 1958:

"if both devices have set the Authentication_Requirements parameter to
one of the MITM Protection Not Required options, authentication stage 1
shall function as if both devices set their IO capabilities to
DisplayOnly (e.g., Numeric comparison with automatic confirmation on
both devices)"

So far our implementation has done user confirmation for all just-works
cases regardless of the MITM requirements, however following the
specification to the word means that we should not be doing confirmation
when neither side has the MITM flag set.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Tested-by: default avatarSzymon Janc <szymon.janc@tieto.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org
parent e694788d
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -3628,8 +3628,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev,


		/* If we're not the initiators request authorization to
		/* If we're not the initiators request authorization to
		 * proceed from user space (mgmt_user_confirm with
		 * proceed from user space (mgmt_user_confirm with
		 * confirm_hint set to 1). */
		 * confirm_hint set to 1). The exception is if neither
		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
		 * side had MITM in which case we do auto-accept.
		 */
		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
		    (loc_mitm || rem_mitm)) {
			BT_DBG("Confirming auto-accept as acceptor");
			BT_DBG("Confirming auto-accept as acceptor");
			confirm_hint = 1;
			confirm_hint = 1;
			goto confirm;
			goto confirm;