Bluetooth: BR/EDR: Store new combination link key
Updates connection object keys using generated link key and mark the key as legacy after successful pairing initiated by remote. Change-Id: Idcd02ea12c45f6f19f6675a2d6161a8349dde170 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
cdd0d308c7
commit
32a86ca351
2 changed files with 15 additions and 3 deletions
|
@ -1523,9 +1523,20 @@ static void link_key_notify(struct net_buf *buf)
|
||||||
|
|
||||||
BT_DBG("%s, link type 0x%02x", bt_addr_str(&evt->bdaddr), evt->key_type);
|
BT_DBG("%s, link type 0x%02x", bt_addr_str(&evt->bdaddr), evt->key_type);
|
||||||
|
|
||||||
/* TODO:
|
if (!conn->keys) {
|
||||||
* classify link key based on conn internals and update keys storage
|
conn->keys = bt_keys_get_link_key(&evt->bdaddr);
|
||||||
*/
|
}
|
||||||
|
if (!conn->keys) {
|
||||||
|
BT_ERR("Can't update keys for %s", bt_addr_str(&evt->bdaddr));
|
||||||
|
bt_conn_unref(conn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(conn->keys->link_key.val, evt->link_key, 16);
|
||||||
|
|
||||||
|
if (evt->key_type == BT_LK_COMBINATION) {
|
||||||
|
atomic_set_bit(&conn->keys->flags, BT_KEYS_BR_LEGACY);
|
||||||
|
}
|
||||||
|
|
||||||
bt_conn_unref(conn);
|
bt_conn_unref(conn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ enum {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BT_KEYS_AUTHENTICATED,
|
BT_KEYS_AUTHENTICATED,
|
||||||
|
BT_KEYS_BR_LEGACY,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bt_ltk {
|
struct bt_ltk {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue