From: Johan Hedberg <johan.hedberg@xxxxxxxxx> It's not strictly speaking required to re-encrypt a link once we receive an LTK since the connection is already encrypted with the STK. However, re-encrypting with the LTK allows us to verify that we've received an LTK that actually works. Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx> --- net/bluetooth/smp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 0de98fe23330..52708f79545f 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1268,6 +1268,13 @@ int smp_distribute_keys(struct l2cap_conn *conn) set_bit(SMP_FLAG_COMPLETE, &smp->smp_flags); smp_notify_keys(conn); + /* Re-encrypt the link with LTK */ + if (smp->ltk) { + struct smp_ltk *ltk = smp->ltk; + hci_le_start_enc(hcon, ltk->ediv, ltk->rand, ltk->val); + hcon->enc_key_size = ltk->enc_size; + } + smp_chan_destroy(conn); return 0; -- 1.8.5.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html