Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256413
b: refs/heads/master
c: 02bc745
h: refs/heads/master
i:
  256411: a23ef88
v: v3
  • Loading branch information
Vinicius Costa Gomes authored and Gustavo F. Padovan committed Jul 8, 2011
1 parent f0e85b3 commit cfedd58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7e62c8592484f79469312fc694d2995918aa152
refs/heads/master: 02bc74556a3f1b26adf3feb372376c56ba990564
12 changes: 12 additions & 0 deletions trunk/net/bluetooth/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,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);
conn->preq[0] = SMP_CMD_PAIRING_REQ;
Expand All @@ -495,6 +506,7 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
smp_send_cmd(conn, SMP_CMD_SECURITY_REQ, sizeof(cp), &cp);
}

done:
hcon->pending_sec_level = sec_level;
set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->pend);

Expand Down

0 comments on commit cfedd58

Please sign in to comment.