diff options
-rw-r--r-- | net/bluetooth/smp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 3d1cc164557d..f2829a7932e2 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -544,7 +544,7 @@ static u8 smp_random(struct smp_chan *smp) | |||
544 | hci_le_start_enc(hcon, ediv, rand, stk); | 544 | hci_le_start_enc(hcon, ediv, rand, stk); |
545 | hcon->enc_key_size = smp->enc_key_size; | 545 | hcon->enc_key_size = smp->enc_key_size; |
546 | } else { | 546 | } else { |
547 | u8 stk[16]; | 547 | u8 stk[16], auth; |
548 | __le64 rand = 0; | 548 | __le64 rand = 0; |
549 | __le16 ediv = 0; | 549 | __le16 ediv = 0; |
550 | 550 | ||
@@ -556,8 +556,13 @@ static u8 smp_random(struct smp_chan *smp) | |||
556 | memset(stk + smp->enc_key_size, 0, | 556 | memset(stk + smp->enc_key_size, 0, |
557 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); | 557 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); |
558 | 558 | ||
559 | if (hcon->pending_sec_level == BT_SECURITY_HIGH) | ||
560 | auth = 1; | ||
561 | else | ||
562 | auth = 0; | ||
563 | |||
559 | hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, | 564 | hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, |
560 | HCI_SMP_STK_SLAVE, 0, stk, smp->enc_key_size, | 565 | HCI_SMP_STK_SLAVE, auth, stk, smp->enc_key_size, |
561 | ediv, rand); | 566 | ediv, rand); |
562 | } | 567 | } |
563 | 568 | ||