Bluetooth: Fix not updating LE keys on Key Refresh Event

If link is already encrypted controller issues "Encryption Key
Refresh Complete" for "LE Start Encryption".

Failing to update keys resulted in invalid security level being set.

Change-Id: I8d8dd1682937bd35a35111366ec6ebdaa619db7c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-01-28 18:09:26 +01:00 committed by Anas Nashif
commit 719e8e4710

View file

@ -899,6 +899,15 @@ static void hci_encrypt_key_refresh_complete(struct net_buf *buf)
return;
}
/*
* Update keys with last pairing info for proper sec level update.
* This is done only for LE transport, for BR/EDR keys are updated on
* HCI 'Link Key Notification Event'
*/
if (conn->type == BT_CONN_TYPE_LE) {
bt_smp_update_keys(conn);
}
update_sec_level(conn);
bt_l2cap_encrypt_change(conn);
bt_conn_security_changed(conn);