Commit 5192d301 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Add comment explainging store hint for long term keys

The code itself is not descriptive on what store hint is used for
long term keys and why. So add some extensive comment here. Similar
to what has already been done for identity resolving key store hint.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent bab6d1e5
...@@ -4771,6 +4771,17 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key) ...@@ -4771,6 +4771,17 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key)
memset(&ev, 0, sizeof(ev)); memset(&ev, 0, sizeof(ev));
/* Devices using resolvable or non-resolvable random addresses
* without providing an indentity resolving key don't require
* to store long term keys. Their addresses will change the
* next time around.
*
* Only when a remote device provides an identity address
* make sure the long term key is stored. If the remote
* identity is known, the long term keys are internally
* mapped to the identity address. So allow static random
* and public addresses here.
*/
if (key->bdaddr_type == ADDR_LE_DEV_RANDOM && if (key->bdaddr_type == ADDR_LE_DEV_RANDOM &&
(key->bdaddr.b[5] & 0xc0) != 0xc0) (key->bdaddr.b[5] & 0xc0) != 0xc0)
ev.store_hint = 0x00; ev.store_hint = 0x00;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment