From cfedd58d1b7a7a0ce385c9ea33a935102812a661 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Thu, 7 Jul 2011 18:59:41 -0300 Subject: [PATCH] --- yaml --- r: 256413 b: refs/heads/master c: 02bc74556a3f1b26adf3feb372376c56ba990564 h: refs/heads/master i: 256411: a23ef88607e6944c7b234a0742868493f8490e46 v: v3 --- [refs] | 2 +- trunk/net/bluetooth/smp.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 68644629b52b..73fd463ba54a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e7e62c8592484f79469312fc694d2995918aa152 +refs/heads/master: 02bc74556a3f1b26adf3feb372376c56ba990564 diff --git a/trunk/net/bluetooth/smp.c b/trunk/net/bluetooth/smp.c index 6df51017df21..5b7217919202 100644 --- a/trunk/net/bluetooth/smp.c +++ b/trunk/net/bluetooth/smp.c @@ -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; @@ -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);