diff options
Diffstat (limited to 'net/bluetooth_mgmt/smp.c')
-rw-r--r-- | net/bluetooth_mgmt/smp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/bluetooth_mgmt/smp.c b/net/bluetooth_mgmt/smp.c index a40db2d..0786fde 100644 --- a/net/bluetooth_mgmt/smp.c +++ b/net/bluetooth_mgmt/smp.c @@ -294,11 +294,16 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) * 3 - NoInputNoOutput * 4 - KeyboardDisplay */ + +/* gen_method[3][4] is changed to JUST_WORKS. + *Although JUST_CFM works with pin 0000, when interacting with NoInputNoOutput, + * such a gesture might be confusing to user. Hence its changed to JUST_WORKS + */ static const u8 gen_method[5][5] = { { JUST_WORKS, JUST_CFM, REQ_PASSKEY, JUST_WORKS, REQ_PASSKEY }, { JUST_WORKS, JUST_CFM, REQ_PASSKEY, JUST_WORKS, REQ_PASSKEY }, { CFM_PASSKEY, CFM_PASSKEY, REQ_PASSKEY, JUST_WORKS, CFM_PASSKEY }, - { JUST_WORKS, JUST_CFM, JUST_WORKS, JUST_WORKS, JUST_CFM }, + { JUST_WORKS, JUST_CFM, JUST_WORKS, JUST_WORKS, JUST_WORKS }, { CFM_PASSKEY, CFM_PASSKEY, REQ_PASSKEY, JUST_WORKS, OVERLAP }, }; @@ -325,7 +330,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, remote_io > SMP_IO_KEYBOARD_DISPLAY) method = JUST_WORKS; else - method = gen_method[local_io][remote_io]; + method = gen_method[remote_io][local_io]; /* If not bonding, don't ask user to confirm a Zero TK */ if (!(auth & SMP_AUTH_BONDING) && method == JUST_CFM) @@ -629,8 +634,7 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) smp_send_cmd(conn, SMP_CMD_PAIRING_RSP, sizeof(rsp), &rsp); /* Request setup of TK */ - /* SSBT :: KJH * loc, rem */ - ret = tk_request(conn, 0, auth, req->io_capability, rsp.io_capability); + ret = tk_request(conn, 0, auth, rsp.io_capability, req->io_capability); if (ret) return SMP_UNSPECIFIED; @@ -671,7 +675,6 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb) auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM; - /* SSBT :: KJH * loc, rem */ ret = tk_request(conn, 0, auth, req->io_capability, rsp->io_capability); if (ret) return SMP_UNSPECIFIED; |