Commit 9cb2e030 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Include security level 4 in connections check

This check is only used for RFCOMM connections and most likely no
RFCOMM based profile will require security level 4 secure connection
security policy. In case it ever does make sure that seucrity level 4
is treated as sufficient security level.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 0ab04a9c
...@@ -860,13 +860,17 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level) ...@@ -860,13 +860,17 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
{ {
BT_DBG("hcon %p", conn); BT_DBG("hcon %p", conn);
if (sec_level != BT_SECURITY_HIGH) /* Accept if non-secure or higher security level is required */
return 1; /* Accept if non-secure is required */ if (sec_level != BT_SECURITY_HIGH && sec_level != BT_SECURITY_FIPS)
return 1;
if (conn->sec_level == BT_SECURITY_HIGH) /* Accept if secure or higher security level is already present */
if (conn->sec_level == BT_SECURITY_HIGH ||
conn->sec_level == BT_SECURITY_FIPS)
return 1; return 1;
return 0; /* Reject not secure link */ /* Reject not secure link */
return 0;
} }
EXPORT_SYMBOL(hci_conn_check_secure); EXPORT_SYMBOL(hci_conn_check_secure);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment