summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorh.sandeep <h.sandeep@samsung.com>2016-11-21 16:44:42 +0530
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:53:30 +0900
commit4905f405a5119a25a7e85be423153b671c86b016 (patch)
treeec8ff417b3413a8d6465a33edab6a2d7dddfb7cb /net
parent9612b4f578275e35d4d8586d923e36161e90a056 (diff)
Bluetooth: Fix IRK distribution issue when Privacy is disabled
The devices, like Android 6.x, which don't support privacy 1.2 couldn't make BLE connection to the device which doesn't distribute IRK when pairing because they use use wrong address type. For compatibility, it needs to distribute IRK even though Privacy feature is disabled. So setting IRK interface is added and BlueZ will set IRK if privacy feature is disabled. And when BLE pairing, IRK will be always distributed. Change-Id: I6dbcef9663a1a0cb2b7db89cad6e725025e41fa1 Signed-off-by: h.sandeep <h.sandeep@samsung.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/smp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 69ad5091e2ce..b5d4bb749b72 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -59,6 +59,11 @@
/* Maximum message length that can be passed to aes_cmac */
#define CMAC_MSG_MAX 80
+#ifdef TIZEN_BT
+#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+#endif
+
enum {
SMP_FLAG_TK_VALID,
SMP_FLAG_CFM_PENDING,
@@ -660,8 +665,13 @@ static void build_pairing_cmd(struct l2cap_conn *conn,
if (hci_dev_test_flag(hdev, HCI_RPA_RESOLVING))
remote_dist |= SMP_DIST_ID_KEY;
+#ifdef TIZEN_BT
+ if (memcmp(hdev->irk, ZERO_KEY, 16))
+ local_dist |= SMP_DIST_ID_KEY;
+#else
if (hci_dev_test_flag(hdev, HCI_PRIVACY))
local_dist |= SMP_DIST_ID_KEY;
+#endif
if (hci_dev_test_flag(hdev, HCI_SC_ENABLED) &&
(authreq & SMP_AUTH_SC)) {