From f6646fcfe84b703d0657a0e827682702d64a4788 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 16 Jan 2009 13:20:07 +0200 Subject: Require MITM for dedicated bonding if the remote side is capable of it --- src/dbus-hci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/dbus-hci.c') diff --git a/src/dbus-hci.c b/src/dbus-hci.c index 994e25cc..e340d4e9 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -1277,8 +1277,14 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, if (*auth == 0x00) { /* If remote requests dedicated bonding follow that lead */ if (device_get_auth(device) == 0x02 || - device_get_auth(device) == 0x03) - *auth = 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) + *auth = 0x02; + else + *auth = 0x03; + } /* If remote requires MITM then also require it */ if (device_get_auth(device) & 0x01) -- cgit