aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/smp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 7435940456ee..96bf16dcd9e9 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1947,6 +1947,18 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
1947 if (!test_bit(SMP_FLAG_SC, &smp->flags)) 1947 if (!test_bit(SMP_FLAG_SC, &smp->flags))
1948 return smp_random(smp); 1948 return smp_random(smp);
1949 1949
1950 if (hcon->out) {
1951 pkax = smp->local_pk;
1952 pkbx = smp->remote_pk;
1953 na = smp->prnd;
1954 nb = smp->rrnd;
1955 } else {
1956 pkax = smp->remote_pk;
1957 pkbx = smp->local_pk;
1958 na = smp->rrnd;
1959 nb = smp->prnd;
1960 }
1961
1950 if (smp->method == REQ_OOB) { 1962 if (smp->method == REQ_OOB) {
1951 if (!hcon->out) 1963 if (!hcon->out)
1952 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, 1964 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM,
@@ -1969,20 +1981,10 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
1969 1981
1970 if (memcmp(smp->pcnf, cfm, 16)) 1982 if (memcmp(smp->pcnf, cfm, 16))
1971 return SMP_CONFIRM_FAILED; 1983 return SMP_CONFIRM_FAILED;
1972
1973 pkax = smp->local_pk;
1974 pkbx = smp->remote_pk;
1975 na = smp->prnd;
1976 nb = smp->rrnd;
1977 } else { 1984 } else {
1978 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, sizeof(smp->prnd), 1985 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, sizeof(smp->prnd),
1979 smp->prnd); 1986 smp->prnd);
1980 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK); 1987 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
1981
1982 pkax = smp->remote_pk;
1983 pkbx = smp->local_pk;
1984 na = smp->rrnd;
1985 nb = smp->prnd;
1986 } 1988 }
1987 1989
1988mackey_and_ltk: 1990mackey_and_ltk: