From ec30bb298fdc3b2f0fa07c455e5cb9f798b70f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edvin?= Date: Tue, 27 Mar 2007 18:04:08 +0000 Subject: [PATCH] add phishing module definition to dconf git-svn-id: file:///var/lib/svn/clamav-devel/branches/temp_dconf_phishenable@2981 77e5149b-7576-45b1-b177-96237e5ba77b --- libclamav/dconf.c | 33 ++++++++++++++++++++++++++++++++- libclamav/dconf.h | 4 ++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/libclamav/dconf.c b/libclamav/dconf.c index daa914de7..13570a4c7 100644 --- a/libclamav/dconf.c +++ b/libclamav/dconf.c @@ -39,6 +39,12 @@ struct dconf_module { uint8_t state; /* default state (on/off) */ }; +#ifdef CL_EXPERIMENTAL +#define DCONF_ENABLE_EXPERIMENTAL 1 +#else +#define DCONF_ENABLE_EXPERIMENTAL 0 +#endif + static struct dconf_module modules[] = { { "PE", "PARITE", PE_CONF_PARITE, 1 }, @@ -88,6 +94,9 @@ static struct dconf_module modules[] = { { "OTHER", "JPEG", OTHER_CONF_JPEG, 1 }, { "OTHER", "CRYPTFF", OTHER_CONF_CRYPTFF, 1 }, + { "PHISHING", "ENGINE", PHISHING_CONF_ENGINE, 1 }, + { "PHISHING", "ENTCONV", PHISHING_CONF_ENTCONV, DCONF_ENABLE_EXPERIMENTAL },/* exp */ + { NULL, NULL, 0, 0 } }; @@ -125,6 +134,9 @@ struct cli_dconf *cli_dconf_init(void) } else if(!strcmp(modules[i].mname, "OTHER")) { if(modules[i].state) dconf->other |= modules[i].bflag; + } else if(!strcmp(modules[i].mname, "PHISHING")) { + if(modules[i].state) + dconf->phishing |= modules[i].bflag; } } @@ -133,7 +145,7 @@ struct cli_dconf *cli_dconf_init(void) void cli_dconf_print(struct cli_dconf *dconf) { - uint8_t pe = 0, elf = 0, arch = 0, doc = 0, mail = 0, other = 0; + uint8_t pe = 0, elf = 0, arch = 0, doc = 0, mail = 0, other = 0, phishing=0; unsigned int i; @@ -197,6 +209,16 @@ void cli_dconf_print(struct cli_dconf *dconf) else continue; } + else if(!strcmp(modules[i].mname, "PHISHING")) { + if(!phishing) { + cli_dbgmsg("Module PHISHING %s\n", dconf->phishing ? "On" : "Off"); + phishing = 1; + } + if(dconf->phishing) + cli_dbgmsg(" * Submodule %10s:\t%s\n", modules[i].sname, (dconf->phishing & modules[i].bflag) ? "On" : "** Off **"); + else + continue; + } } } @@ -309,6 +331,15 @@ int cli_dconf_load(FILE *fd, struct cl_engine **engine, unsigned int options) break; } } + + if(!strncmp(buffer, "PHISHING:", 9) && chkflevel(buffer, 2)) { + if(sscanf(buffer + 9, "0x%x", &val) == 1) { + dconf->phishing = val; + } else { + ret = CL_EMALFDB; + break; + } + } } if(ret) { diff --git a/libclamav/dconf.h b/libclamav/dconf.h index ea9455fec..6d92628c3 100644 --- a/libclamav/dconf.h +++ b/libclamav/dconf.h @@ -31,6 +31,7 @@ struct cli_dconf { uint32_t doc; uint32_t mail; uint32_t other; + uint32_t phishing; }; /* PE flags */ @@ -80,6 +81,9 @@ struct cli_dconf { #define OTHER_CONF_JPEG 0x8 #define OTHER_CONF_CRYPTFF 0x10 +/* Phishing flags */ +#define PHISHING_CONF_ENGINE 0x1 +#define PHISHING_CONF_ENTCONV 0x2 struct cli_dconf *cli_dconf_init(void); void cli_dconf_print(struct cli_dconf *dconf);