Commit graph

102 commits

Author SHA1 Message Date
John Humlick
e1e3d4c64d
libclamav: Add URI scanning support to PDF parser
Threat Research requests scanning URIs in PDF files and adding them to
the json report file.

This change adds URI scanning support to the PDF parser, including
support for object references to URIs in PDF files.

Jira: CLAM-2588

Fix out-of-order references and other minor improvements.

CLAM-2588, CLAM-2757
2025-05-30 12:41:17 -07:00
Val Snyder
7ff29b8c37
Bump copyright dates for 2025 2025-02-14 10:24:30 -05:00
rsundriyal
5a84081574
New release version changes
Signed-off-by: rsundriyal <ravis069@gmail.com>
2024-08-21 11:53:20 -04:00
Micah Snyder
ef50f797a0 News: Release notes for recent patch versions
And update the BCAPI FLEVEL enum.
2024-05-06 14:26:32 -07:00
Micah Snyder
1e5ddefcee Clang-format touchup 2024-03-15 13:18:47 -04:00
rsundriyal
24226f765f Bumped version from 1.3.0 -> 1.4.0-devel for new release changes 2024-02-08 13:46:21 -05:00
Micah Snyder
5f934c16b4 Update bytecode api functionality levels and add news from recent patch versions 2024-02-05 20:18:20 +00:00
Micah Snyder
9cb28e51e6 Bump copyright dates for 2024 2024-01-22 11:27:17 -05:00
rasundri
1ba3f035d3 Bumped version from 1.2.0 -> 1.3.0-devel
FLEVEL 190 -> 200

Updated the News to have section for the new version and added previous patch versions.
2023-08-31 11:09:37 -07:00
Micah Snyder
f898714557 Bumped version from 1.1.0 -> 1.2.0-devel
FLEVEL 180 -> 190

Update the NEWS to have a section for the new version.
2023-05-04 10:42:21 -07:00
Micah Snyder
57601ce86d Set release candidate version suffix and bump SOVERSION
Change the version suffix from -devel-{TODAY} to -rc

Bump the SO version for libclamav and libfreshclam.
Increasing the current version to 12.0.0 and 3.0.0 respectively.
The reason is that we reintroduced using the version scripts:
- libclamav.map
- libfreshclam.map
- libclamunrar.map
- libclamunrar_iface.map

Note that libclamunrar and libclamunrar_iface use the SO version from
libclamav.

Note that libclammspack does not have a .map file and so is not getting
symbol versioning at this time nor are we bumping the SO version for
that library.
2023-03-30 12:03:57 -07:00
Micah Snyder
6eebecc303 Bump copyright for 2023 2023-02-12 11:20:22 -08:00
Micah Snyder
7db16d8c7a Bumped version from 1.1.0 -> 1.1.0-devel
FLEVEL 160 -> 180

Update the NEWS to have a section for the new version.
2022-12-02 14:22:31 -08:00
Micah Snyder
0dd6ab3f16 Set -rc version suffix; bump libclamav SO version
In preparation for the release candidate, changing the version suffix
from devel to rc.

Increment SO current version to 11, because we added to the public API.
Increment SO age to 2, because we didn't change anything or remove
anything from the public API.

Added functionality level values to the bytecode API enum for recent
patch versions.
2022-10-24 21:12:20 -07:00
Micah Snyder
3dff2e2f52 Bumped version from 0.105.0 -> 1.0.0-devel
FLEVEL 150 -> 160

Update the NEWS to have:
- a section for the new version.
- the latest details about all the previous patch versions.
2022-05-10 10:24:20 -07:00
Micah Snyder
15eef50656 Code cleanup: Refactor to clean up formatting issues
Refactored the clamscan code that determines 'what to scan' in order
to clean up some very messy logic and also to get around a difference in
how vscode and clang-format handle formatting #ifdef blocks in the
middle of an else/if.

In addition to refactoring, there is a slight behavior improvement. With
this change, doing `clamscan blah -` will now scan `blah` and then also
scan `stdin`.  You can even do `clamscan - blah` to now scan `stdin` and
then scan `blah`. Before, The `-` had to be the only "filename" argument
in order to scan from stdin.

In addition, added a bunch of extra empty lines or changing multi-line
function calls to single-line function calls in order to get around a
bug in clang-format with these two options do not playing nice together:
- AlignConsecutiveAssignments: true
- AlignAfterOpenBracket: true

AlignAfterOpenBracket is not taking account the spaces inserted by
AlignConsecutiveAssignments, so you end up with stuff like this:
```c
    bleeblah = 1;
    blah     = function(arg1,
                    arg2,
                    arg3);

                //  ^--- these args 4-left from where they should be.
```

VSCode, meanwhile, somehow fixes this whitespace issue so code that is
correctly formatted by VSCode doesn't have this bug, meaning that:

1. The clang-format check in GH Actions fails.
2. We'd all have to stop using format-on-save in VSCode and accept the
  bug if we wanted those GH Actions tests to pass.

Adding an empty line before variable assignments from multi-line
function calls evades the buggy behavior.

This commit should resolve the clang-format github action test failures,
for now.
2022-03-22 10:42:46 -07:00
mko-x
a21cc6dcd7
Add explicit log level parameter to application logging API
* Added loglevel parameter to logg()

* Fix logg and mprintf internals with new loglevels

* Update all logg calls to set loglevel

* Update all mprintf calls to set loglevel

* Fix hidden logg calls

* Executed clam-format
2022-02-15 15:13:55 -08:00
micasnyd
140c88aa4e Bump copyright for 2022
Includes minor format corrections.
2022-01-09 14:23:25 -07:00
Micah Snyder
b47745b691 Bump version from 0.104.0 -> 0.105.0-devel-${TODAY}
Also increase FLEVEL from 140 -> 150.
2021-08-24 18:14:40 -07:00
Micah Snyder
11b66a8350 libclamav: Increase FLEVEL by 10 more to 140
For reference, version 0.103 started at 120 and we're already at 124
with v0.103.3.

Ordinarily we would reserve 10 FLEVELs for each feature release, but
we're implementing a new Long Term Support (LTS) program and will be
starting with 0.103, which means additional critical bug fixes for the
0.103 series for the next 2-3 years.

This commit pushes v0.104's FLEVEL to 140 to ensure that there will be
enough FLEVELs for future 0.103 patch versions.
2021-08-14 15:04:21 -07:00
Micah Snyder
bae444a25b clang-format housekeeping 2021-04-09 19:08:14 -07:00
Micah Snyder
1d21a57c83 NEWS.md: Updates from recent patch versions
Also adds the bytecode enum value for 0.103.2.
2021-04-09 10:05:51 -07:00
Micah Snyder
94a2888222 Bumped version from 0.103.0 -> 0.104.0-devel
FLEVEL       121   -> 130
libclamav    9:5:0 -> 9:6:0
libfreshclam 2:1:0 -> 2:2:0
2020-10-16 03:10:49 -07:00
Micah Snyder
9e08216c1a Update NEWS. Change 0.103.0-devel -> 0.104.0-rc
Update the NEWS to add and correct content prior to the release
candidate.

Changed the version string to have the -rc suffix.

Also fixed a couple of --help and manpage issues.
2020-08-13 13:34:47 -07:00
Micah Snyder (micasnyd)
9e20cdf6ea Add CMake build tooling
This patch adds experimental-quality CMake build tooling.

The libmspack build required a modification to use "" instead of <> for
header #includes. This will hopefully be included in the libmspack
upstream project when adding CMake build tooling to libmspack.

Removed use of libltdl when using CMake.

Flex & Bison are now required to build.

If -DMAINTAINER_MODE, then GPERF is also required, though it currently
doesn't actually do anything.  TODO!

I found that the autotools build system was generating the lexer output
but not actually compiling it, instead using previously generated (and
manually renamed) lexer c source. As a consequence, changes to the .l
and .y files weren't making it into the build. To resolve this, I
removed generated flex/bison files and fixed the tooling to use the
freshly generated files. Flex and bison are now required build tools.
On Windows, this adds a dependency on the winflexbison package,
which can be obtained using Chocolatey or may be manually installed.

CMake tooling only has partial support for building with external LLVM
library, and no support for the internal LLVM (to be removed in the
future). I.e. The CMake build currently only supports the bytecode
interpreter.

Many files used include paths relative to the top source directory or
relative to the current project, rather than relative to each build
target. Modern CMake support requires including internal dependency
headers the same way you would external dependency headers (albeit
with "" instead of <>). This meant correcting all header includes to
be relative to the build targets and not relative to the workspace.

For example, ...

```c
include "../libclamav/clamav.h"
include "clamd/clamd_others.h"
```

... becomes:

```c
// libclamav
include "clamav.h"

// clamd
include "clamd_others.h"
```

Fixes header name conflicts by renaming a few of the files.

Converted the "shared" code into a static library, which depends on
libclamav. The ironically named "shared" static library provides
features common to the ClamAV apps which are not required in
libclamav itself and are not intended for use by downstream projects.
This change was required for correct modern CMake practices but was
also required to use the automake "subdir-objects" option.
This eliminates warnings when running autoreconf which, in the next
version of autoconf & automake are likely to break the build.

libclamav used to build in multiple stages where an earlier stage is
a static library containing utils required by the "shared" code.
Linking clamdscan and clamdtop with this libclamav utils static lib
allowed these two apps to function without libclamav. While this is
nice in theory, the practical gains are minimal and it complicates
the build system. As such, the autotools and CMake tooling was
simplified for improved maintainability and this feature was thrown
out. clamdtop and clamdscan now require libclamav to function.

Removed the nopthreads version of the autotools
libclamav_internal_utils static library and added pthread linking to
a couple apps that may have issues building on some platforms without
it, with the intention of removing needless complexity from the
source. Kept the regular version of libclamav_internal_utils.la
though it is no longer used anywhere but in libclamav.

Added an experimental doxygen build option which attempts to build
clamav.h and libfreshclam doxygen html docs.

The CMake build tooling also may build the example program(s), which
isn't a feature in the Autotools build system.

Changed C standard to C90+ due to inline linking issues with socket.h
when linking libfreshclam.so on Linux.

Generate common.rc for win32.

Fix tabs/spaces in shared Makefile.am, and remove vestigial ifndef
from misc.c.

Add CMake files to the automake dist, so users can try the new
CMake tooling w/out having to build from a git clone.

clamonacc changes:
- Renamed FANOTIFY macro to HAVE_SYS_FANOTIFY_H to better match other
  similar macros.
- Added a new clamav-clamonacc.service systemd unit file, based on
  the work of ChadDevOps & Aaron Brighton.
- Added missing clamonacc man page.

Updates to clamdscan man page, add missing options.

Remove vestigial CL_NOLIBCLAMAV definitions (all apps now use
libclamav).

Rename Windows mspack.dll to libmspack.dll so all ClamAV-built
libraries have the lib-prefix with Visual Studio as with CMake.
2020-08-13 00:25:34 -07:00
Micah Snyder
e2f59af30a Clang-format touchup 2020-07-24 16:37:25 -07:00
Jonas Zaddach (jzaddach)
cd977727f0 Add LZMA & BZip2 decompression to bytecode API
Adds LZMA and BZip2 decompression routines to the bytecode API.
The ability to decompress LZMA and BZip2 streams is particularly
useful for bytecode signatures that extend clamav executable
unpacking capabilities.

Of note, the LZMA format is not well standardized. This API
expects the stream to start with the LZMA_Alone header.

Also fixed a bug in LZMA dictionary size setting.
2020-04-29 09:26:07 -07:00
Micah Snyder
206dbaefe8 Update copyright dates for 2020 2020-01-03 15:44:07 -05:00
Micah Snyder
d4a9a760fc Version increment from 0.102 -> 0.103.
Bumps the version from 0.102.0 to 0.103.0-devel-<date>.
Bumps the FLEVEL from 111 to 120.
Bumps the libclamav and libfreshclam revision numbers from 4 -> 5, and 0 -> 1, respectively.
2019-10-15 12:26:31 -04:00
Micah Snyder (micasnyd)
b819efc769 Updated version strings for 0.102.0-rc. 2019-10-02 16:08:30 -04:00
Micah Snyder (micasnyd)
9c58ba7bd7 Update to clamav-devel to synchronize with the clamav-bytecode-compiler project. 2019-10-02 16:08:24 -04:00
Jonas Zaddach
c84683f2f4 Mach-O bytecode unpackers 2019-10-02 16:08:21 -04:00
Jonas Zaddach
2b776e4b89 Linux bytecode unpackers 2019-10-02 16:08:21 -04:00
Micah Snyder
52cddcbcfd Updating and cleaning up copyright notices. 2019-10-02 16:08:18 -04:00
Micah Snyder
8d53f30804 Added 0.101.1 version information, flevel enum value. Increased the FLEVEL setting to 110 for 0.102.0 devel. Increased the libclamav revision value to account for the clamav-types.h change. 2019-10-02 16:08:17 -04:00
Micah Snyder
2e26e12cab Changing ClamAV version number from 0.101.0 to 0.102.0-devel. 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
Micah Snyder
38fe8b69a0 Added .clang-format style rules, clam-format script to automate formatting of ClamAV code, and preparing select files so that clang-format does not alter carefully formatted sections. 2019-10-02 16:08:16 -04:00
Micah Snyder
3c43fffda7 Improvements to signature writing documentation. Notably the inclusion of a comprehensive CL_TYPE file type reference, requested by in bb11408. 2018-12-02 23:07:07 -05:00
Micah Snyder (micasnyd)
2f28382694 Updated version string to 0.101-rc and incremented the FLEVEL to 101. 2018-12-02 23:07:07 -05:00
Micah Snyder
420426dd5f Incrementing the libclamav version numbers to 9.0.0 and setting the version strings to 0.101.0-beta. 2018-12-02 23:07:06 -05:00
Micah Snyder
531ba0a361 Adding FUNC_LEVEL_0100_2 to bytecode api following recent 0.100.2 release. 2018-12-02 23:07:01 -05:00
Micah Snyder
d7979d4ff7 Restructured scan options flags from a single bitflag field to a structure containing multiple bitflag fields. This also required adding a new function to the bytecode API to get scan options a la carte, and modifying the existing function to hand back scan options in the old/deprecated uint32_t bitflag format. Re-generated bytecode iface header files.
Updated libclamav documentation detailing new scan options structure.
Renamed references to 'algorithmic' detection to 'heuristic' detection. Renaming references to 'properties' to 'collect metadata'.
Renamed references to 'scan all' to 'scan all match'.
Renamed a couple of 'Hueristic.*' signature names as 'Heuristics.*' signatures (plural) to match majority of other heuristics.
2018-12-02 23:06:59 -05:00
Micah Snyder
9957ff3c66 Adding bytecode functionlity level for 0.100.1. Incrementing the CL_FLEVEL to 100 for 0.101. 2018-07-30 09:14:28 -04:00
Micah Snyder
d64cd9defd Updated version-related strings, structs, FLEVEL for 0.101.0(-devel). 2018-07-30 09:14:11 -04:00
Micah Snyder (micasnyd)
88005aeb12 bb12085: Converting some constants from enums to defines, because the enums may be evaluated as signed on some systems - notably solaris, causing issues if he value is greater than MAX_INT. 2018-07-30 09:14:07 -04:00
Micah Snyder
c9893ef062 Adding missing commas to FunctionalityLevels enum definition where newer version numbers were added. 2018-04-02 07:58:51 -04:00
Micah Snyder
64e2fedac7 Updated the NEWS.md, and reformatted it to improve the markdown. updated the version string from 0.100.0-rc to 0.100.0 in preparation for the release. 2018-04-02 07:58:46 -04:00
Mickey Sola
46a35abe56 mass update of copyright headers 2015-09-17 13:41:26 -04:00
Kevin Lin
47c2d618cd added BC_PRECLASS hook support; replaces target type 13 2015-03-03 15:00:55 -05:00