smp.c (7e95e365d5399647a41e10059e4b09826b82d78b) smp.c (6c9d42a1615c6dc19c4a57a77d9c4b3d779bb741)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 as
7 published by the Free Software Foundation;
8

--- 170 unchanged lines hidden (view full) ---

179 BT_DBG("code 0x%2.2x", code);
180
181 if (!skb)
182 return;
183
184 skb->priority = HCI_PRIO_MAX;
185 hci_send_acl(conn->hchan, skb, 0);
186
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 as
7 published by the Free Software Foundation;
8

--- 170 unchanged lines hidden (view full) ---

179 BT_DBG("code 0x%2.2x", code);
180
181 if (!skb)
182 return;
183
184 skb->priority = HCI_PRIO_MAX;
185 hci_send_acl(conn->hchan, skb, 0);
186
187 mod_timer(&conn->security_timer, jiffies +
187 cancel_delayed_work_sync(&conn->security_timer);
188 schedule_delayed_work(&conn->security_timer,
188 msecs_to_jiffies(SMP_TIMEOUT));
189}
190
191static void build_pairing_cmd(struct l2cap_conn *conn,
192 struct smp_cmd_pairing *req,
193 struct smp_cmd_pairing *rsp,
194 __u8 authreq)
195{

--- 39 unchanged lines hidden (view full) ---

235static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
236{
237 if (send)
238 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason),
239 &reason);
240
241 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->pend);
242 mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason);
189 msecs_to_jiffies(SMP_TIMEOUT));
190}
191
192static void build_pairing_cmd(struct l2cap_conn *conn,
193 struct smp_cmd_pairing *req,
194 struct smp_cmd_pairing *rsp,
195 __u8 authreq)
196{

--- 39 unchanged lines hidden (view full) ---

236static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send)
237{
238 if (send)
239 smp_send_cmd(conn, SMP_CMD_PAIRING_FAIL, sizeof(reason),
240 &reason);
241
242 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->pend);
243 mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason);
243 del_timer(&conn->security_timer);
244 cancel_delayed_work_sync(&conn->security_timer);
244 smp_chan_destroy(conn);
245}
246
247static void confirm_work(struct work_struct *work)
248{
249 struct smp_chan *smp = container_of(work, struct smp_chan, confirm);
250 struct l2cap_conn *conn = smp->conn;
251 struct crypto_blkcipher *tfm;

--- 543 unchanged lines hidden (view full) ---

795
796 smp_send_cmd(conn, SMP_CMD_SIGN_INFO, sizeof(sign), &sign);
797
798 *keydist &= ~SMP_DIST_SIGN;
799 }
800
801 if (conn->hcon->out || force) {
802 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend);
245 smp_chan_destroy(conn);
246}
247
248static void confirm_work(struct work_struct *work)
249{
250 struct smp_chan *smp = container_of(work, struct smp_chan, confirm);
251 struct l2cap_conn *conn = smp->conn;
252 struct crypto_blkcipher *tfm;

--- 543 unchanged lines hidden (view full) ---

796
797 smp_send_cmd(conn, SMP_CMD_SIGN_INFO, sizeof(sign), &sign);
798
799 *keydist &= ~SMP_DIST_SIGN;
800 }
801
802 if (conn->hcon->out || force) {
803 clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend);
803 del_timer(&conn->security_timer);
804 cancel_delayed_work_sync(&conn->security_timer);
804 smp_chan_destroy(conn);
805 }
806
807 return 0;
808}
805 smp_chan_destroy(conn);
806 }
807
808 return 0;
809}