aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index de53ba1905fe..82824213d0fb 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2515,6 +2515,16 @@ static int smp_cmd_public_key(struct l2cap_conn *conn, struct sk_buff *skb)
2515 2515
2516 memcpy(smp->remote_pk, key, 64); 2516 memcpy(smp->remote_pk, key, 64);
2517 2517
2518 if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) {
2519 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk,
2520 smp->rr, 0, cfm.confirm_val);
2521 if (err)
2522 return SMP_UNSPECIFIED;
2523
2524 if (memcmp(cfm.confirm_val, smp->pcnf, 16))
2525 return SMP_CONFIRM_FAILED;
2526 }
2527
2518 /* Non-initiating device sends its public key after receiving 2528 /* Non-initiating device sends its public key after receiving
2519 * the key from the initiating device. 2529 * the key from the initiating device.
2520 */ 2530 */
@@ -2562,16 +2572,6 @@ static int smp_cmd_public_key(struct l2cap_conn *conn, struct sk_buff *skb)
2562 return sc_passkey_round(smp, SMP_CMD_PUBLIC_KEY); 2572 return sc_passkey_round(smp, SMP_CMD_PUBLIC_KEY);
2563 } 2573 }
2564 2574
2565 if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) {
2566 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk,
2567 smp->rr, 0, cfm.confirm_val);
2568 if (err)
2569 return SMP_UNSPECIFIED;
2570
2571 if (memcmp(cfm.confirm_val, smp->pcnf, 16))
2572 return SMP_CONFIRM_FAILED;
2573 }
2574
2575 if (smp->method == REQ_OOB) { 2575 if (smp->method == REQ_OOB) {
2576 if (hcon->out) 2576 if (hcon->out)
2577 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, 2577 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM,