Bluetooth: Store the key if auth type is P192 29/87929/7
authorSudha Bheemanna <b.sudha@samsung.com>
Mon, 12 Sep 2016 07:16:44 +0000 (12:46 +0530)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 29 Sep 2016 05:40:26 +0000 (14:40 +0900)
This patch allows to store the key after authentication
if auth type is "HCI_LK_AUTH_COMBINATION_P192"

Change-Id: Ie44dbe7dfec361edab61aceaf9b2ca4057b88fa5
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
net/bluetooth/hci_core.c

index c821ee72c8fc0752b0580b774e5807275b44c28e..39f2026dc477546aae9a844e2b1db9c2ab5aec8d 100644 (file)
@@ -2309,6 +2309,14 @@ static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
        if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03)
                return true;
 
+#ifdef TIZEN_BT
+       /* In case of auth_type '0x01', it is authenticated by MITM.
+        * So store it.
+        */
+       if (key_type == HCI_LK_AUTH_COMBINATION_P192)
+               return true;
+#endif
+
        /* If none of the above criteria match, then don't store the key
         * persistently */
        return false;