diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-02-01 11:32:25 -0800 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-13 09:51:43 +0200 |
commit | 9cb2e030e6a0787f5c216702e6e78dd85ffe04c4 (patch) | |
tree | 163e21166ce5a71534d655fa224f5e196aa4b0b8 /net | |
parent | 0ab04a9c0e8e37ca495fb08c8b83615c5f144551 (diff) | |
download | blackbird-op-linux-9cb2e030e6a0787f5c216702e6e78dd85ffe04c4.tar.gz blackbird-op-linux-9cb2e030e6a0787f5c216702e6e78dd85ffe04c4.zip |
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: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 7ef5bffb61aa..801820f12226 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -860,13 +860,17 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level) { BT_DBG("hcon %p", conn); - if (sec_level != BT_SECURITY_HIGH) - return 1; /* Accept if non-secure is required */ + /* Accept if non-secure or higher security level 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 0; /* Reject not secure link */ + /* Reject not secure link */ + return 0; } EXPORT_SYMBOL(hci_conn_check_secure); |