mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 07:32:29 +02:00
Bluetooth: Use the stored LTK for restabilishing security
Now that it's possible that the exchanged key is present in the link key list, we may be able to estabilish security with an already existing key, without need to perform any SMP procedure. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
07021e2708
commit
b7d6cd72ce
|
|
@ -785,6 +785,17 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
|
|||
|
||||
if (hcon->link_mode & HCI_LM_MASTER) {
|
||||
struct smp_cmd_pairing cp;
|
||||
struct link_key *key;
|
||||
|
||||
key = hci_find_link_key_type(hcon->hdev, conn->dst,
|
||||
HCI_LK_SMP_LTK);
|
||||
if (key) {
|
||||
struct key_master_id *master = (void *) key->data;
|
||||
|
||||
hci_le_start_enc(hcon, master->ediv, master->rand,
|
||||
key->val);
|
||||
goto done;
|
||||
}
|
||||
|
||||
build_pairing_cmd(conn, &cp, NULL, authreq);
|
||||
smp->preq[0] = SMP_CMD_PAIRING_REQ;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user