Bluetooth: GATT: Replace check for CONFIG_BT_SMP
Make use of bt_conn_get_security instead of accessing conn->sec_level directly. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
e1ae80c038
commit
c736de05fa
1 changed files with 1 additions and 5 deletions
|
@ -1867,13 +1867,9 @@ u8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
|||
|
||||
mask &= attr->perm;
|
||||
if (mask & BT_GATT_PERM_AUTHEN_MASK) {
|
||||
#if defined(CONFIG_BT_SMP)
|
||||
if (conn->sec_level < BT_SECURITY_L3) {
|
||||
if (bt_conn_get_security(conn) < BT_SECURITY_L3) {
|
||||
return BT_ATT_ERR_AUTHENTICATION;
|
||||
}
|
||||
#else
|
||||
return BT_ATT_ERR_AUTHENTICATION;
|
||||
#endif /* CONFIG_BT_SMP */
|
||||
}
|
||||
|
||||
if ((mask & BT_GATT_PERM_ENCRYPT_MASK)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue