mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 10:23:17 +00:00
PDF : make matcher check for pdf phash
libclamav/matcher : check for CL_TYPE_PDF to match image hash libclamav/scanners: change place of calculate_fuzzy_image_hash call so it's run in matcher
This commit is contained in:
parent
4cd9578df9
commit
1ea486f6b7
2 changed files with 5 additions and 3 deletions
|
@ -186,6 +186,7 @@ static inline cl_error_t matcher_run(const struct cli_matcher *root,
|
|||
}
|
||||
|
||||
switch (ftype) {
|
||||
case CL_TYPE_PDF:
|
||||
case CL_TYPE_GIF:
|
||||
case CL_TYPE_TIFF:
|
||||
case CL_TYPE_JPEG:
|
||||
|
|
|
@ -4900,6 +4900,10 @@ cl_error_t cli_magic_scan(cli_ctx *ctx, cli_file_t type)
|
|||
ret = cli_scan_structured(ctx);
|
||||
break;
|
||||
|
||||
case CL_TYPE_PDF:
|
||||
if (SCAN_PARSE_PDF && (DCONF_DOC & DOC_CONF_PDF))
|
||||
(void)calculate_fuzzy_image_hash(ctx, type);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4995,9 +4999,6 @@ cl_error_t cli_magic_scan(cli_ctx *ctx, cli_file_t type)
|
|||
if (SCAN_PARSE_PDF && (DCONF_DOC & DOC_CONF_PDF))
|
||||
ret = cli_scanpdf(ctx, 0);
|
||||
|
||||
// we may still want to calculate the fuzzy hash for the rendering page, even if parsing fail as the pdf parser is different and may parse the file sucessfully
|
||||
(void)calculate_fuzzy_image_hash(ctx, type);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue