Bluetooth: SMP: Add support for Secure Connection Only Mode

This patch introduce new Kconfig option that is used to indicate if
device should operate in Secure Connection Only Mode. Enabling this
option removes support for LE Legacy Pairing.

Change-Id: If224b6786f4c840959fe87a31f0224bc1e21f90e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2015-12-08 16:59:19 +01:00 committed by Anas Nashif
commit f80deda9d2
5 changed files with 74 additions and 5 deletions

View file

@ -213,6 +213,12 @@ int bt_conn_security(struct bt_conn *conn, bt_security_t sec)
return -ENOTCONN;
}
#if defined(CONFIG_BLUETOOTH_SMP_SC_ONLY)
if (sec < BT_SECURITY_FIPS) {
return -EOPNOTSUPP;
}
#endif/* CONFIG_BLUETOOTH_SMP_SC_ONLY */
/* nothing to do */
if (conn->sec_level >= sec || conn->required_sec_level >= sec) {
return 0;