提交 df8e1a4c 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

Bluetooth: Set link key generation bit if necessary for LE SC

Depending on whether Secure Connections is enabled or not we may need to add
the link key generation bit to the key distribution. This patch does the
necessary modifications to the build_pairing_cmd() function.
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 f3a73d97
...@@ -333,6 +333,16 @@ static void build_pairing_cmd(struct l2cap_conn *conn, ...@@ -333,6 +333,16 @@ static void build_pairing_cmd(struct l2cap_conn *conn,
if (test_bit(HCI_PRIVACY, &hdev->dev_flags)) if (test_bit(HCI_PRIVACY, &hdev->dev_flags))
local_dist |= SMP_DIST_ID_KEY; local_dist |= SMP_DIST_ID_KEY;
if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags)) {
if ((authreq & SMP_AUTH_SC) &&
test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
local_dist |= SMP_DIST_LINK_KEY;
remote_dist |= SMP_DIST_LINK_KEY;
}
} else {
authreq &= ~SMP_AUTH_SC;
}
if (rsp == NULL) { if (rsp == NULL) {
req->io_capability = conn->hcon->io_capability; req->io_capability = conn->hcon->io_capability;
req->oob_flag = SMP_OOB_NOT_PRESENT; req->oob_flag = SMP_OOB_NOT_PRESENT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册