aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-04-28 12:04:55 -0400
committerMarcel Holtmann <marcel@holtmann.org>2009-04-28 12:31:39 -0400
commit3fdca1e1370ffe89980927cdef0583bebcd8caaf (patch)
tree30ec395081409d7cea5338cf4f486eaabd14e53d /net/bluetooth
parent052b30b0a8eec8db5b18ad49effdf2a9ba4c1e1a (diff)
Bluetooth: Fix connection establishment with low security requirement
The Bluetooth 2.1 specification introduced four different security modes that can be mapped using Legacy Pairing and Simple Pairing. With the usage of Simple Pairing it is required that all connections (except the ones for SDP) are encrypted. So even the low security requirement mandates an encrypted connection when using Simple Pairing. When using Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required since it causes interoperability issues. To support this properly the low security requirement translates into different host controller transactions depending if Simple Pairing is supported or not. However in case of Simple Pairing the command to switch on encryption after a successful authentication is not triggered for the low security mode. This patch fixes this and actually makes the logic to differentiate between Simple Pairing and Legacy Pairing a lot simpler. Based on a report by Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 75ebbe2221a3..375f4b4f7f79 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -425,12 +425,9 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
425 if (sec_level == BT_SECURITY_SDP) 425 if (sec_level == BT_SECURITY_SDP)
426 return 1; 426 return 1;
427 427
428 if (sec_level == BT_SECURITY_LOW) { 428 if (sec_level == BT_SECURITY_LOW &&
429 if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0) 429 (!conn->ssp_mode || !conn->hdev->ssp_mode))
430 return hci_conn_auth(conn, sec_level, auth_type); 430 return 1;
431 else
432 return 1;
433 }
434 431
435 if (conn->link_mode & HCI_LM_ENCRYPT) 432 if (conn->link_mode & HCI_LM_ENCRYPT)
436 return hci_conn_auth(conn, sec_level, auth_type); 433 return hci_conn_auth(conn, sec_level, auth_type);