Driver: fortcout: Fix Zones checking

This commit is contained in:
Nodir Temirkhodjaev 2023-12-19 20:51:47 +03:00
parent 09a864de55
commit d34a22f6bd
5 changed files with 11 additions and 12 deletions

View File

@ -187,7 +187,7 @@ FORT_API BOOL fort_conf_ip_included(const PFORT_CONF conf,
FORT_API BOOL fort_conf_app_exe_equal(
const PFORT_APP_ENTRY app_entry, const PVOID path, UINT32 path_len)
{
const char *app_path = (const char *) (app_entry + 1);
const PVOID app_path = app_entry + 1;
const UINT32 app_path_len = app_entry->path_len;
if (path_len != app_path_len)
@ -250,7 +250,7 @@ static FORT_APP_ENTRY fort_conf_app_wild_find(
static int fort_conf_app_prefix_cmp(PFORT_APP_ENTRY app_entry, const PVOID path, UINT32 path_len)
{
const char *app_path = (const char *) (app_entry + 1);
const PVOID app_path = app_entry + 1;
const UINT32 app_path_len = app_entry->path_len;
if (path_len > app_path_len)

View File

@ -16,8 +16,8 @@
#define FORT_CONF_STR_ALIGN 4
#define FORT_CONF_STR_HEADER_SIZE(n) (((n) + 1) * sizeof(UINT32))
#define FORT_CONF_STR_DATA_SIZE(size) FORT_ALIGN_SIZE((size), FORT_CONF_STR_ALIGN)
#define FORT_CONF_APP_ENTRY_SIZE(len) \
(sizeof(FORT_APP_ENTRY) + (len) + sizeof(WCHAR)) /* include terminating zero */
#define FORT_CONF_APP_ENTRY_SIZE(path_len) \
(sizeof(FORT_APP_ENTRY) + (path_len) + sizeof(WCHAR)) /* include terminating zero */
typedef struct fort_conf_flags
{

View File

@ -132,7 +132,7 @@ static NTSTATUS fort_conf_ref_exe_new_entry(PFORT_CONF_REF conf_ref, const PVOID
/* Copy path */
{
char *new_path = (char *) (entry + 1);
PVOID new_path = entry + 1;
RtlCopyMemory(new_path, path, path_len);
}
@ -180,7 +180,7 @@ FORT_API NTSTATUS fort_conf_ref_exe_add_path(
FORT_API NTSTATUS fort_conf_ref_exe_add_entry(
PFORT_CONF_REF conf_ref, const PFORT_APP_ENTRY entry, BOOL locked)
{
const PVOID path = (const PVOID)(entry + 1);
const PVOID path = entry + 1;
const UINT32 path_len = entry->path_len;
const FORT_APP_FLAGS flags = entry->flags;

View File

@ -244,10 +244,11 @@ inline static BOOL fort_callout_ale_is_allowed(PCFORT_CALLOUT_ARG ca, PFORT_CALL
return !cx->blocked /* collect traffic, when Filter Disabled */
/* "Allow, if not blocked" or "Ask to Connect" */
|| fort_callout_ale_is_new(conf_flags, app_data)
/* "Allow, if not blocked" or "Ask to Connect" */
|| !fort_callout_ale_is_zone_blocked(ca, cx, conf_ref, app_data)
/* check the conf for a blocked app */
|| !fort_conf_app_blocked(&conf_ref->conf, app_data.flags, &cx->block_reason);
|| !(
/* check LAN Only and Zones */
fort_callout_ale_is_zone_blocked(ca, cx, conf_ref, app_data)
/* check the conf for a blocked app */
|| fort_conf_app_blocked(&conf_ref->conf, app_data.flags, &cx->block_reason));
}
inline static void fort_callout_ale_log(PCFORT_CALLOUT_ARG ca, PFORT_CALLOUT_ALE_EXTRA cx,

View File

@ -17,8 +17,6 @@ class ConfAppsWalker;
class EnvManager;
class FirewallConf;
struct fort_traf;
using longs_arr_t = QVector<quint32>;
using shorts_arr_t = QVector<quint16>;
using chars_arr_t = QVector<qint8>;