aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-16 08:09:13 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-17 05:43:06 -0400
commit02f3e25457915728624b976b0382601b5605ad64 (patch)
tree266106d60c4dea230f27155631434d3c80e7ab4e /net
parent9f743d7499bc2c4dc8c35af33bdb2a29bea663b9 (diff)
Bluetooth: Don't bother user space without IO capabilities
If user space has a NoInputNoOutput IO capability it makes no sense to bother it with confirmation requests. This patch updates both SSP and SMP to check for the local IO capability before sending a user confirmation request to user space. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c4
-rw-r--r--net/bluetooth/smp.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 1ac526022ad9..1bd4de7e74fc 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3752,9 +3752,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev,
3752 /* If we're not the initiators request authorization to 3752 /* If we're not the initiators request authorization to
3753 * proceed from user space (mgmt_user_confirm with 3753 * proceed from user space (mgmt_user_confirm with
3754 * confirm_hint set to 1). The exception is if neither 3754 * confirm_hint set to 1). The exception is if neither
3755 * side had MITM in which case we do auto-accept. 3755 * side had MITM or if the local IO capability is
3756 * NoInputNoOutput, in which case we do auto-accept
3756 */ 3757 */
3757 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && 3758 if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
3759 conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
3758 (loc_mitm || rem_mitm)) { 3760 (loc_mitm || rem_mitm)) {
3759 BT_DBG("Confirming auto-accept as acceptor"); 3761 BT_DBG("Confirming auto-accept as acceptor");
3760 confirm_hint = 1; 3762 confirm_hint = 1;
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 70b726518d7b..74a0308e39f3 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -431,6 +431,10 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
431 if (method == JUST_CFM && test_bit(SMP_FLAG_INITIATOR, &smp->flags)) 431 if (method == JUST_CFM && test_bit(SMP_FLAG_INITIATOR, &smp->flags))
432 method = JUST_WORKS; 432 method = JUST_WORKS;
433 433
434 /* Don't bother user space with no IO capabilities */
435 if (method == JUST_CFM && hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT)
436 method = JUST_WORKS;
437
434 /* If Just Works, Continue with Zero TK */ 438 /* If Just Works, Continue with Zero TK */
435 if (method == JUST_WORKS) { 439 if (method == JUST_WORKS) {
436 set_bit(SMP_FLAG_TK_VALID, &smp->flags); 440 set_bit(SMP_FLAG_TK_VALID, &smp->flags);