From 6edb4f19c145eb8b0e9edc224588a23d771ae70b Mon Sep 17 00:00:00 2001 From: Bhakthavatsala Raghavendra Date: Fri, 4 Nov 2011 16:07:41 +0530 Subject: [PATCH] Bluetooth: Setting security level based on remote device capabilities Security level will be set to MEDIUM in case where the remote device is 2.0 device. This would prevent it from going to 16 digit pairing in case where the remote device sends the EIR and still doesn't support SSP CRs-fixed: 318469 Change-Id: I9d03b2b628cc188de44f44cfc3f8e81fbf3cb79d Signed-off-by: Bhakthavatsala Raghavendra --- net/bluetooth/hci_event.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 13d9b7154ef..45aa228af12 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2708,6 +2708,11 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b ie->data.ssp_mode = (ev->features[0] & 0x01); conn->ssp_mode = (ev->features[0] & 0x01); + /*In case if remote device ssp supported/2.0 device + reduce the security level to MEDIUM if it is HIGH*/ + if (!conn->ssp_mode && + (conn->pending_sec_level == BT_SECURITY_HIGH)) + conn->pending_sec_level = BT_SECURITY_MEDIUM; } if (conn->state != BT_CONFIG)