dconf: added passwd dconf for archives, applied to unzip

This commit is contained in:
Kevin Lin 2015-07-16 12:35:38 -04:00
parent 0b119e6f78
commit f5f7b7a1b9
3 changed files with 7 additions and 1 deletions

View file

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

View file

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

View file

@ -362,7 +362,11 @@ static inline int zdecrypt(const uint8_t *src, uint32_t csize, uint32_t usize, c
if (!ctx || !ctx->engine) if (!ctx || !ctx->engine)
return CL_ENULLARG; 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; password = ctx->engine->pw_dict;