Bluetooth: SMP: Fix using JustWorks when MITM was required

JustWorks pairing should be forced only if both sides don't require
MITM. Code checking this was incorrect and forced JustWorks even if
one side required MITM.

Change-Id: I70312b6832218f430546896ae1f2283ae6ce7c60
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2015-11-05 14:05:59 +01:00 committed by Anas Nashif
commit 89cfd86f2f

View file

@ -142,7 +142,7 @@ static uint8_t get_pair_method(struct bt_smp *smp, uint8_t remote_io)
rsp = (struct bt_smp_pairing *)&smp->prsp[1];
/* if none side requires MITM use JustWorks */
if (!(req->auth_req & rsp->auth_req & BT_SMP_AUTH_MITM)) {
if (!((req->auth_req | rsp->auth_req) & BT_SMP_AUTH_MITM)) {
return JUST_WORKS;
}