Bluetooth: Store the key if auth type is P192
authorSudha Bheemanna <b.sudha@samsung.com>
Mon, 12 Sep 2016 07:16:44 +0000 (12:46 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 29 Apr 2025 03:38:26 +0000 (12:38 +0900)
This patch allows to store the key after authentication
if auth type is "HCI_LK_AUTH_COMBINATION_P192"

Change-Id: I76b8d39f3063eb6591fde3f23ebb0103fea243af
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
net/bluetooth/hci_core.c

index aa4653bad49bb393763847fdcb049a3ae8fc750f..792cbc469949efc7263eda7908775e45e355dbc0 100644 (file)
@@ -1193,6 +1193,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;