Bluetooth: L2CAP: Make CoC depend on SMP

This is necessary in order to properly handle security errors which are
part of the testing specification thus can influence qualification.

Change-Id: If444e753be9196f3d5bb36cea00e332a33aa249f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-11-03 11:25:23 +02:00 committed by Johan Hedberg
commit d1ae81eddd
3 changed files with 2 additions and 2 deletions

View file

@ -457,6 +457,7 @@ config NETWORKING_WITH_BT
select BLUETOOTH
select BLUETOOTH_PERIPHERAL
select BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
select BLUETOOTH_SMP
default n
help
Enable Bluetooth driver that send and receives IPv6 packets,

View file

@ -253,6 +253,7 @@ endif # BLUETOOTH_SMP
config BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
bool "L2CAP Dynamic Channel support"
depends on BLUETOOTH_SMP
default n
help
This option enables support for LE Connection oriented Channels,

View file

@ -608,13 +608,11 @@ static void le_conn_req(struct bt_l2cap *l2cap, uint8_t ident,
goto rsp;
}
#if defined(CONFIG_BLUETOOTH_SMP)
/* Check if connection has minimum required security level */
if (conn->sec_level < server->sec_level) {
rsp->result = sys_cpu_to_le16(BT_L2CAP_ERR_AUTHENTICATION);
goto rsp;
}
#endif /* CONFIG_BLUETOOTH_SMP */
if (!L2CAP_LE_CID_IS_DYN(scid)) {
rsp->result = sys_cpu_to_le16(BT_L2CAP_ERR_INVALID_SCID);