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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 6ce7785a2708..68e6f245581c 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -538,6 +538,7 @@ static u8 smp_random(struct smp_chan *smp)
538 538
539 hci_le_start_enc(hcon, ediv, rand, stk); 539 hci_le_start_enc(hcon, ediv, rand, stk);
540 hcon->enc_key_size = smp->enc_key_size; 540 hcon->enc_key_size = smp->enc_key_size;
541 set_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags);
541 } else { 542 } else {
542 u8 stk[16], auth; 543 u8 stk[16], auth;
543 __le64 rand = 0; 544 __le64 rand = 0;
@@ -856,6 +857,9 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
856 hci_le_start_enc(hcon, key->ediv, key->rand, key->val); 857 hci_le_start_enc(hcon, key->ediv, key->rand, key->val);
857 hcon->enc_key_size = key->enc_size; 858 hcon->enc_key_size = key->enc_size;
858 859
860 /* We never store STKs for master role, so clear this flag */
861 clear_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags);
862
859 return true; 863 return true;
860} 864}
861 865