dconf: added passwd dconf for archives, applied to unzip

pull/8/merge
Kevin Lin 10 years ago
parent 0b119e6f78
commit f5f7b7a1b9
  1. 1
      libclamav/dconf.c
  2. 1
      libclamav/dconf.h
  3. 6
      libclamav/unzip.c

@ -102,6 +102,7 @@ static struct dconf_module modules[] = {
{ "ARCHIVE", "XAR", ARCH_CONF_XAR, 1 },
{ "ARCHIVE", "HFSPLUS", ARCH_CONF_HFSPLUS, 1 },
{ "ARCHIVE", "XZ", ARCH_CONF_XZ, 1 },
{ "ARCHIVE", "PASSWD", ARCH_CONF_PASSWD, 1 },
{ "DOCUMENT", "HTML", DOC_CONF_HTML, 1 },
{ "DOCUMENT", "RTF", DOC_CONF_RTF, 1 },

@ -90,6 +90,7 @@ struct cli_dconf {
#define ARCH_CONF_XAR 0x80000
#define ARCH_CONF_HFSPLUS 0x100000
#define ARCH_CONF_XZ 0x200000
#define ARCH_CONF_PASSWD 0x400000
/* Document flags */
#define DOC_CONF_HTML 0x1

@ -362,7 +362,11 @@ static inline int zdecrypt(const uint8_t *src, uint32_t csize, uint32_t usize, c
if (!ctx || !ctx->engine)
return CL_ENULLARG;
/* TODO - dconf going here */
/* dconf */
if (ctx->dconf && !(ctx->dconf->archive & ARCH_CONF_PASSWD)) {
cli_dbgmsg("cli_unzip: decrypt - skipping encrypted file\n");
return CL_SUCCESS;
}
password = ctx->engine->pw_dict;

Loading…
Cancel
Save