diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 66abb984cba..10726e69eea 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -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)) {