From 8dc9d59d5e01a57893a927f033368255dd9551c9 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 16 Jan 2009 13:27:20 +0200 Subject: Also check the local IO capability before requiring MITM --- src/dbus-hci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/dbus-hci.c') diff --git a/src/dbus-hci.c b/src/dbus-hci.c index e340d4e9..36bd0c94 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -1278,9 +1278,12 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, /* If remote requests dedicated bonding follow that lead */ if (device_get_auth(device) == 0x02 || device_get_auth(device) == 0x03) { - /* If the remote has NoInputNoOutput then don't require - * MITM, otherwise require it */ - if (device_get_cap(device) == 0x03) + uint8_t agent_cap = agent_get_io_capability(agent); + + /* If both remote and local IO capabilities allow MITM + * then require it, otherwise don't */ + if (device_get_cap(device) == 0x03 || + agent_cap == 0x03) *auth = 0x02; else *auth = 0x03; -- cgit