diff options
author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-08-03 23:12:09 +0200 |
---|---|---|
committer | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-08-03 23:12:09 +0200 |
commit | 52215890ef7c4d06fd3323f8315d85f14d637a91 (patch) | |
tree | 2f97aaab909de9fa903ba52224f6f643e2f25cf5 /net/bluetooth_mgmt/smp.c | |
parent | 4309a7ffa8aa46ac2fc4090cebc3efeb00dce72f (diff) | |
download | kernel_samsung_smdk4412-52215890ef7c4d06fd3323f8315d85f14d637a91.zip kernel_samsung_smdk4412-52215890ef7c4d06fd3323f8315d85f14d637a91.tar.gz kernel_samsung_smdk4412-52215890ef7c4d06fd3323f8315d85f14d637a91.tar.bz2 |
samsung opensource update4
Change-Id: I9db25f213bb1577c4468873c66b230a0566b6cf2
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; |