aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-01-16 01:37:39 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 02:51:35 -0500
commit7b5a9241b780ea2f77e71647bc0d3c9708c18ef1 (patch)
tree6848c9d768079cc02d95f911ebb3ca4d666c62c6 /net/bluetooth/hci_conn.c
parenteb9a8f3fb6762a4e6ae0aa9e96532c9c544f400e (diff)
Bluetooth: Introduce requirements for security level 4
The security level 4 is a new strong security requirement that is based around 128-bit equivalent strength for link and encryption keys required using FIPS approved algorithms. Which means that E0, SAFER+ and P-192 are not allowed. Only connections created with P-256 resulting from using Secure Connections support are allowed. This security level needs to be enforced when Secure Connection Only mode is enabled for a controller or a service requires FIPS compliant strong security. Currently it is not possible to enable either of these two cases. This patch just puts in the foundation for being able to handle security level 4 in the future. It should be noted that devices or services with security level 4 requirement can only communicate using Bluetooth 4.1 controllers with support for Secure Connections. There is no backward compatibilty if used with older hardware. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index cf96b3438a91..0266bd8e4913 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -800,10 +800,17 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
800 if (!(conn->link_mode & HCI_LM_AUTH)) 800 if (!(conn->link_mode & HCI_LM_AUTH))
801 goto auth; 801 goto auth;
802 802
803 /* An authenticated combination key has sufficient security for any 803 /* An authenticated FIPS approved combination key has sufficient
804 security level. */ 804 * security for security level 4. */
805 if (conn->key_type == HCI_LK_AUTH_COMBINATION_P192 || 805 if (conn->key_type == HCI_LK_AUTH_COMBINATION_P256 &&
806 conn->key_type == HCI_LK_AUTH_COMBINATION_P256) 806 sec_level == BT_SECURITY_FIPS)
807 goto encrypt;
808
809 /* An authenticated combination key has sufficient security for
810 security level 3. */
811 if ((conn->key_type == HCI_LK_AUTH_COMBINATION_P192 ||
812 conn->key_type == HCI_LK_AUTH_COMBINATION_P256) &&
813 sec_level == BT_SECURITY_HIGH)
807 goto encrypt; 814 goto encrypt;
808 815
809 /* An unauthenticated combination key has sufficient security for 816 /* An unauthenticated combination key has sufficient security for
@@ -818,7 +825,8 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
818 is generated using maximum PIN code length (16). 825 is generated using maximum PIN code length (16).
819 For pre 2.1 units. */ 826 For pre 2.1 units. */
820 if (conn->key_type == HCI_LK_COMBINATION && 827 if (conn->key_type == HCI_LK_COMBINATION &&
821 (sec_level != BT_SECURITY_HIGH || conn->pin_length == 16)) 828 (sec_level == BT_SECURITY_MEDIUM || sec_level == BT_SECURITY_LOW ||
829 conn->pin_length == 16))
822 goto encrypt; 830 goto encrypt;
823 831
824auth: 832auth: