aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-13 08:24:02 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-13 10:48:47 -0400
commitc8462ca65f39d9402c52ef0c5f338a466bb34b43 (patch)
tree287d7faf086cfc1ee98a5c89d6a1431b66a1091b
parent6f59b904ae57df92915d7ade750853647620db2c (diff)
Bluetooth: Fix input address type for SMP C1 function
The smp_c1() so far always assumed public addresses as input for its operation. However it should provide actually the source address type of the actual connection. Finally the source address type is tracked in hci_conn->src_type and so use that one as input. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/smp.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index f57b20908ed5..112e58153f92 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -387,13 +387,13 @@ static void confirm_work(struct work_struct *work)
387 smp->tfm = tfm; 387 smp->tfm = tfm;
388 388
389 if (conn->hcon->out) 389 if (conn->hcon->out)
390 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 0, 390 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
391 &conn->hcon->src, conn->hcon->dst_type, 391 conn->hcon->src_type, &conn->hcon->src,
392 &conn->hcon->dst, res); 392 conn->hcon->dst_type, &conn->hcon->dst, res);
393 else 393 else
394 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 394 ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
395 conn->hcon->dst_type, &conn->hcon->dst, 0, 395 conn->hcon->dst_type, &conn->hcon->dst,
396 &conn->hcon->src, res); 396 conn->hcon->src_type, &conn->hcon->src, res);
397 if (ret) { 397 if (ret) {
398 reason = SMP_UNSPECIFIED; 398 reason = SMP_UNSPECIFIED;
399 goto error; 399 goto error;
@@ -427,11 +427,13 @@ static void random_work(struct work_struct *work)
427 BT_DBG("conn %p %s", conn, conn->hcon->out ? "master" : "slave"); 427 BT_DBG("conn %p %s", conn, conn->hcon->out ? "master" : "slave");
428 428
429 if (hcon->out) 429 if (hcon->out)
430 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 0, 430 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
431 &hcon->src, hcon->dst_type, &hcon->dst, res); 431 hcon->src_type, &hcon->src,
432 hcon->dst_type, &hcon->dst, res);
432 else 433 else
433 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 434 ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
434 hcon->dst_type, &hcon->dst, 0, &hcon->src, res); 435 hcon->dst_type, &hcon->dst,
436 hcon->src_type, &hcon->src, res);
435 if (ret) { 437 if (ret) {
436 reason = SMP_UNSPECIFIED; 438 reason = SMP_UNSPECIFIED;
437 goto error; 439 goto error;