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

Commit 659c7fb0 authored by Marcel Holtmann's avatar Marcel Holtmann
Browse files

Bluetooth: Fix OOB data present value for BR/EDR Secure Connections



When BR/EDR Secure Connections has been enabled, the OOB data present
value can take 2 additional values. The host has to clearly provide
details about if P-192 OOB data, P-256 OOB data or a combination of
P-192 and P-256 OOB data is present.

In case BR/EDR Secure Connections is not enabled or not supported,
then check that P-192 OOB data is actually present and return the
correct value based on that.

Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent f7697b16
Loading
Loading
Loading
Loading
+18 −1
Original line number Original line Diff line number Diff line
@@ -3881,8 +3881,25 @@ static u8 bredr_oob_data_present(struct hci_conn *conn)
	     !memcmp(data->hash256, ZERO_KEY, 16)))
	     !memcmp(data->hash256, ZERO_KEY, 16)))
		return 0x00;
		return 0x00;


	if (conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags))
	if (conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)) {
		/* When Secure Connections has been enabled, then just
		 * return the present value stored with the OOB data. It
		 * will contain the right information about which data
		 * is present.
		 */
		if (bredr_sc_enabled(hdev))
			return data->present;

		/* When Secure Connections is not enabled or actually
		 * not supported by the hardware, then check that if
		 * P-192 data values are present.
		 */
		if (!memcmp(data->rand192, ZERO_KEY, 16) ||
		    !memcmp(data->hash192, ZERO_KEY, 16))
			return 0x00;

		return 0x01;
		return 0x01;
	}


	return 0x00;
	return 0x00;
}
}