Commit 4bd6d38e authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Remove unneeded "force" parameter from smp_distribute_keys()

Now that to-be-received keys are properly tracked we no-longer need the
"force" parameter to smp_distribute_keys(). It was essentially acting as
an indicator whether all keys have been received, but now it's just
redundant together with smp->remote_key_dist.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent efabba37
...@@ -7267,7 +7267,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) ...@@ -7267,7 +7267,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
if (hcon->type == LE_LINK) { if (hcon->type == LE_LINK) {
if (!status && encrypt) if (!status && encrypt)
smp_distribute_keys(conn, 0); smp_distribute_keys(conn);
cancel_delayed_work(&conn->security_timer); cancel_delayed_work(&conn->security_timer);
} }
......
...@@ -960,7 +960,7 @@ static int smp_cmd_master_ident(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -960,7 +960,7 @@ static int smp_cmd_master_ident(struct l2cap_conn *conn, struct sk_buff *skb)
rp->ediv, rp->rand); rp->ediv, rp->rand);
smp->ltk = ltk; smp->ltk = ltk;
if (!(smp->remote_key_dist & SMP_DIST_ID_KEY)) if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
smp_distribute_keys(conn, 1); smp_distribute_keys(conn);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
return 0; return 0;
...@@ -1018,7 +1018,7 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn, ...@@ -1018,7 +1018,7 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
*/ */
if (!bacmp(&info->bdaddr, BDADDR_ANY)) { if (!bacmp(&info->bdaddr, BDADDR_ANY)) {
BT_ERR("Ignoring IRK with no identity address"); BT_ERR("Ignoring IRK with no identity address");
smp_distribute_keys(conn, 1); smp_distribute_keys(conn);
return 0; return 0;
} }
...@@ -1039,7 +1039,7 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn, ...@@ -1039,7 +1039,7 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
l2cap_conn_update_id_addr(hcon); l2cap_conn_update_id_addr(hcon);
smp_distribute_keys(conn, 1); smp_distribute_keys(conn);
return 0; return 0;
} }
...@@ -1168,7 +1168,7 @@ static void smp_notify_keys(struct l2cap_conn *conn) ...@@ -1168,7 +1168,7 @@ static void smp_notify_keys(struct l2cap_conn *conn)
} }
} }
int smp_distribute_keys(struct l2cap_conn *conn, __u8 force) int smp_distribute_keys(struct l2cap_conn *conn)
{ {
struct smp_cmd_pairing *req, *rsp; struct smp_cmd_pairing *req, *rsp;
struct smp_chan *smp = conn->smp_chan; struct smp_chan *smp = conn->smp_chan;
...@@ -1176,7 +1176,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force) ...@@ -1176,7 +1176,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
struct hci_dev *hdev = hcon->hdev; struct hci_dev *hdev = hcon->hdev;
__u8 *keydist; __u8 *keydist;
BT_DBG("conn %p force %d", conn, force); BT_DBG("conn %p", conn);
if (!test_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) if (!test_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
return 0; return 0;
......
...@@ -145,7 +145,7 @@ struct smp_chan { ...@@ -145,7 +145,7 @@ struct smp_chan {
bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level); bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level);
int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); int smp_conn_security(struct hci_conn *hcon, __u8 sec_level);
int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); int smp_distribute_keys(struct l2cap_conn *conn);
int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey);
void smp_chan_destroy(struct l2cap_conn *conn); void smp_chan_destroy(struct l2cap_conn *conn);
......
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