Commit graph

44 commits

Author SHA1 Message Date
Val Snyder
7ff29b8c37
Bump copyright dates for 2025 2025-02-14 10:24:30 -05:00
Micah Snyder
a729aafc38 Remove PCRE dead code
As of ClamAV 0.105, PCRE2 is required. PCRE (1) is not an option, and
there is also no option to disable PCRE support.

This commit removes the dead code associated with those old build
options.
2024-04-13 12:34:15 -04:00
Micah Snyder
9cb28e51e6 Bump copyright dates for 2024 2024-01-22 11:27:17 -05:00
Micah Snyder
6eebecc303 Bump copyright for 2023 2023-02-12 11:20:22 -08:00
Michael Orlitzky
7374029897 */*: fix invalid prototypes.
Prototypes (or the declarations themselves, if there is no
corresponding prototype) for functions that take no arguments are
required by the C standard to specify (void) as their argument list;
for example,

  regex_pcre.h:79:1: error: function declaration isn't a prototype
  [-Werror=strict-prototypes]
     79 | cl_error_t cli_pcre_init_internal();

Future versions of clang may become strict about this, and there's no
harm in conforming to the standard right now, so we fix all such
instances in this commit.
2022-11-22 23:22:57 -08:00
Micah Snyder
fd587c741c Image fuzzy hash: new logical sub-signature feature
Add a new logical signature subsignature type for matching on images
with image fuzzy hashes.

Image fuzzy hash subsigantures follow this format:

    fuzzy_img#<hash>#<dist>

In this initial implementation, the hamming distance (dist) is ignored
and only exact fuzzy hash matches will alert.

Fuzzy hash matching is only performed for supported image types.

Also: removed some excessive debug log messages on start-up.

Fixed an issue where the signature name (virname) is being allocated and
stored for every subsignature or even ever sub-pattern in an AC-pattern
(i.e. NDB sig or LDB subsig) containing a `{n-m}` or `*` wildcard.
This fix is only for LDB subsigs though. NDB signatures are still
allocaing one virname per sub-pattern.

This fix was required because I needed a place to store the virname with
fuzzy-hash subsignatures. Storing it in the fuzzy-hash subsig
metadatathe way AC-pattern, PCRE, and BComp subsigs were doing it
wouldn't work because it would cross the C-Rust FFI boundary and giving
pointers to Rust allocated stuff is dicey. Not to mention native Rust
strings are different thatn C strings. Anyways, the correct thing to do
was to store the virname with the actual logical signature.

TODO: Keep track of NDB signatures in the same way and store the virname
for NDB sigs there instead of in AC-patterns so that we can get rid of
the virname field in the AC-pattern struct.
2022-03-02 13:12:59 -07:00
micasnyd
140c88aa4e Bump copyright for 2022
Includes minor format corrections.
2022-01-09 14:23:25 -07:00
Micah Snyder (micasnyd)
b9ca6ea103 Update copyright dates for 2021
Also fixes up clang-format.
2021-03-19 15:12:26 -07:00
Micah Snyder
840b559c7a Remove Visual Studio project files
Visual Studio projects removed in favor of CMake because it's far easier
to build and maintain. Also removed the old InnoSetup installer now that
CMake's CPack provides installer creation.

While working on this I found that the THIS_IS_CLAMAV macro was missing,
resulting in warnings for the `have_rar` and `have_clamjit` exported
global variables.

I also stumbled across some code duplication and more cl_error_t / int
type issues in the pcre code, so this commit includes a little cleanup.
2021-02-25 11:41:27 -08:00
Micah Snyder
206dbaefe8 Update copyright dates for 2020 2020-01-03 15:44:07 -05:00
Micah Snyder
5f4f69102d Correcting types from int to cl_error_t where appropriate. Eliminating unused variables and referencing unused parameters to remove warnings. 2019-10-02 16:08:25 -04:00
Micah Snyder
52cddcbcfd Updating and cleaning up copyright notices. 2019-10-02 16:08:18 -04:00
Micah Snyder
b3e82e5e61 Replacing libclamav/cltypes.h with clamav-types.h.in, which generates a header clamav-types.h that we install alongside clamav.h. 2019-10-02 16:08:17 -04:00
Micah Snyder
72fd33c8b2 clang-format'd using new .clang-format rules. 2019-10-02 16:08:16 -04:00
Mickey Sola
dfa92896d2 bcomp - general fixups and cleanup for byte compare code 2018-12-02 23:07:03 -05:00
Mickey Sola
18ff502920 refactoring byte compare functionality as a subsig; adding loader and matchers for bytecompare subsig 2018-12-02 23:07:03 -05:00
Mickey Sola
9e408e7658 bb4007 - adding pcre byte sequence comparison functions 2018-12-02 23:07:03 -05:00
Mickey Sola
ecbdd3864f bb4007 - adding pcre flag for byte sequence comparison 2018-12-02 23:07:03 -05:00
Mickey Sola
46a35abe56 mass update of copyright headers 2015-09-17 13:41:26 -04:00
Kevin Lin
a6d2b523d0 bb#11377 - stub pcre functions for dynamic library mapping 2015-08-21 12:43:26 -04:00
Kevin Lin
0118458fe6 pcre: swapped pcre meta fields to using mempool 2015-07-23 14:11:21 -04:00
Kevin Lin
2d785c9611 added virname argument for matcher-pcre (use for later filetyping and test cases) 2015-06-03 15:28:09 -04:00
Kevin Lin
6f594861a5 added limited regex support to yara signatures
TODO: generate trigger lsigs
2014-12-10 18:29:52 -05:00
Kevin Lin
10aaf4c389 added pcre modes to matcher 2014-10-28 13:38:57 -04:00
Kevin Lin
18a1c96286 pcre subsig offset behavior follows hex substrs
pcre: added rolling option (r) for older (normal pcre) behavior
pcre: adjusted handling of CLI_OFF_ANY based subsigs
2014-10-27 16:48:34 -04:00
Kevin Lin
b8de92172d pcre: added virname to performance tracking names 2014-10-27 15:53:41 -04:00
Kevin Lin
86eddf118f set cli_virname argument to use const qualifier
pcre: added field to track virname
virname is tracked when a lsig is a single bypass pcre subsig
2014-10-09 13:23:29 -04:00
Kevin Lin
7f5c687b39 windows build: removed inline tag 2014-10-01 17:16:09 -04:00
Kevin Lin
62c009937f fixed build compilation when compiled without pcre support 2014-09-18 14:11:27 -04:00
Kevin Lin
31439f0044 Merge branch [performance tracking] into klin/pcre_support
Conflicts:
	libclamav/matcher-pcre.c
	libclamav/matcher-pcre.h
2014-09-16 16:02:16 -04:00
Kevin Lin
5c2c723361 added pcre execution time and match performance tracking
fixed an issue with statistics reporting with no signatures loaded
2014-09-16 15:56:56 -04:00
Kevin Lin
82fa5ba043 pcre: added disabling mechanism to metas and matcher
dconf: added field specific for pcre features
dconf: added overall support dconf for pcre
2014-09-15 18:10:11 -04:00
Kevin Lin
6bf32a7327 pcre: removed obsolete function
pcre: corrected error code for failed pcre_compile
pcre: added pcre_exec error code conversion
pcre: cleaned-up development notes
2014-09-11 16:17:39 -04:00
Kevin Lin
0d37009816 sigtool/pcre: pcre subsig id and exe support in sigtool 2014-09-11 12:27:52 -04:00
Kevin Lin
7ab4eec702 pcre: support for clamav styled offsets
pcre: added encompass ('e') option to matcher
2014-09-09 17:14:12 -04:00
Kevin Lin
efda620107 pcre: cleaned up old commented-out code
pcre: implemented global matching (g) using end-of-match continuation
pcre: started work on fullinfo debug diagnostics
2014-09-03 00:29:47 -04:00
Kevin Lin
39597f2557 pcre: added compiler option parsing 2014-09-02 17:22:22 -04:00
Kevin Lin
35a05ff85f pcre: update matcher structure to allow for additional fields
pcre: changed trigger from content match to logical trigger
2014-08-29 15:35:01 -04:00
Kevin Lin
ed67e2698e moved macro 2014-08-28 17:42:11 -04:00
Kevin Lin
a84ef0ccd8 pcre: enforced content match trigger
matcher-pcre: renamed old functions to be unconditonal pcres
2014-08-28 14:37:55 -04:00
Kevin Lin
9bc7c13882 pcre: added and linked options to set match_limit and match_limit_recursion
pcre: separated parsing function into parsing and compiling functions
2014-08-25 19:11:12 -04:00
Kevin Lin
7afaa9bd22 pcre: encased pcre segments in macros to fix build without pcre support 2014-08-25 15:07:30 -04:00
Kevin Lin
f40a96fbda pcre: implemented rough support for matching and count
HIGHLY EXPERIMENTAL
2014-08-22 17:29:40 -04:00
Kevin Lin
5fa733692a pcre: support and linking for parsing and freeing 2014-08-22 14:39:17 -04:00