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: I196b6e726bff3a396ba040201c760f74ddfba946
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
/* Maximum message length that can be passed to aes_cmac */
#define CMAC_MSG_MAX 80
+#ifdef CONFIG_TIZEN_WIP
+#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,
if (test_bit(HCI_RPA_RESOLVING, &hdev->dev_flags))
remote_dist |= SMP_DIST_ID_KEY;
+#ifdef CONFIG_TIZEN_WIP
+ if (memcmp(hdev->irk, ZERO_KEY, 16))
+ local_dist |= SMP_DIST_ID_KEY;
+#else
if (test_bit(HCI_PRIVACY, &hdev->dev_flags))
local_dist |= SMP_DIST_ID_KEY;
+#endif
if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags) &&
(authreq & SMP_AUTH_SC)) {