Skip to content

Commit b371edd

Browse files
committed
WIP: FIPS-compliant CVD signing and verification
Add X509 certificate chain based signing with PKCS7-PEM external signatures distributed alongside CVD's in a custom .cvd.sign format. Add a Rust implementation for parsing, verifying, and unpacking CVD files. Now installs a 'certs' directory in the app config directory (e.g. <prefix>/etc/certs). The install location is configurable. The CMake option to configure the CVD certs directory is: `-D CVD_CERTS_DIRECTORY=PATH` New options to set an alternative CVD certs directory: - Commandline for freshclam, clamd, clamscan, and sigtool is: `--cvdcertsdir PATH` - Env variable for freshclam, clamd, clamscan, and sigtool is: `CVD_CERTS_DIR` - Config option for freshclam and clamd is: `CVDCertsDirectory PATH` Sigtool: - Add sign/verify commands. - Also verify CDIFF external digital signatures when applying CDIFFs. - Place commonly used commands at the top of --help string. - Fix up manpage. Freshclam: - Will try to download .sign files to verify CVDs and CDIFFs. - Fix an issue where making a CLD would only include the CFG file for daily and not if patching any other database. libclamav.so: - Bump version to 13:0:1 (aka 12.1.0). - Also remove libclamav.map versioning. Resolves: #1304 - Add two new API's to the public clamav.h header: ```c extern cl_error_t cl_cvdverify_ex(const char *file, const char *certs_directory); extern cl_error_t cl_cvdunpack_ex(const char *file, const char *dir, bool dont_verify, const char *certs_directory); ``` The original `cl_cvdverify` and `cl_cvdunpack` are deprecated. - Add `cl_engine_field` enum option `CL_ENGINE_CVDCERTSDIR`. You may set this option with `cl_engine_set_str` and get it with `cl_engine_get_str`, to override the compiled in default CVD certs directory. libfreshclam.so: Bump version to 4:0:0 (aka 4.0.0). Adds sigtool sign/verify tests and test certs Make it so downloadFile doesn't throw a warning if the server doesn't have the .sign file.
1 parent 52b2017 commit b371edd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5034
-1016
lines changed

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ set(PACKAGE_URL "https://www.clamav.net/")
3636
HexVersion(PACKAGE_VERSION_NUM ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
3737

3838
# libtool library versioning rules: http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
39-
set(LIBCLAMAV_CURRENT 12)
40-
set(LIBCLAMAV_REVISION 3)
41-
set(LIBCLAMAV_AGE 0)
39+
set(LIBCLAMAV_CURRENT 13)
40+
set(LIBCLAMAV_REVISION 0)
41+
set(LIBCLAMAV_AGE 1)
4242

4343
math(EXPR LIBCLAMAV_SOVERSION "${LIBCLAMAV_CURRENT} - ${LIBCLAMAV_AGE}")
4444
set(LIBCLAMAV_VERSION "${LIBCLAMAV_SOVERSION}.${LIBCLAMAV_AGE}.${LIBCLAMAV_REVISION}")
4545
HexVersion(LIBCLAMAV_VERSION_NUM ${LIBCLAMAV_CURRENT} ${LIBCLAMAV_REVISION} ${LIBCLAMAV_AGE})
4646

47-
set(LIBFRESHCLAM_CURRENT 3)
48-
set(LIBFRESHCLAM_REVISION 2)
47+
set(LIBFRESHCLAM_CURRENT 4)
48+
set(LIBFRESHCLAM_REVISION 0)
4949
set(LIBFRESHCLAM_AGE 0)
5050

5151
math(EXPR LIBFRESHCLAM_SOVERSION "${LIBFRESHCLAM_CURRENT} - ${LIBFRESHCLAM_AGE}")
@@ -925,6 +925,12 @@ if(IS_ABSOLUTE ${DATABASE_DIRECTORY})
925925
else()
926926
set(DATADIR "${CMAKE_INSTALL_PREFIX}/${DATABASE_DIRECTORY}")
927927
endif()
928+
# Absolute path of ClamAV CA certificates directory
929+
if(IS_ABSOLUTE ${CVD_CERTS_DIRECTORY})
930+
set(CERTSDIR "${CVD_CERTS_DIRECTORY}")
931+
else()
932+
set(CERTSDIR "${CMAKE_INSTALL_PREFIX}/${CVD_CERTS_DIRECTORY}")
933+
endif()
928934
# Absolute path of the applications' config directory
929935
if(IS_ABSOLUTE ${APP_CONFIG_DIRECTORY})
930936
set(CONFDIR "${APP_CONFIG_DIRECTORY}")

CMakeOptions.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ if(WIN32)
77
set(DATABASE_DIRECTORY
88
"database" CACHE STRING
99
"Database directory.")
10+
set(CVD_CERTS_DIRECTORY
11+
"certs" CACHE STRING
12+
"ClamAV CA certificates directory.")
1013
else()
1114
set(APP_CONFIG_DIRECTORY
1215
"etc" CACHE STRING
1316
"App Config directory.")
1417
set(DATABASE_DIRECTORY
1518
"share/clamav" CACHE STRING
1619
"Database directory.")
20+
set(CVD_CERTS_DIRECTORY
21+
"${APP_CONFIG_DIRECTORY}/certs" CACHE STRING
22+
"ClamAV CA certificates directory.")
1723
endif()
1824

1925
set(CLAMAV_USER "clamav" CACHE STRING "ClamAV User")

0 commit comments

Comments
 (0)