Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Added functions used for the matching of CPEs to rules. #828

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ if (BUILD_TESTS AND NOT SKIP_SRC)
add_custom_target (tests
DEPENDS array-test alivedetection-test boreas_error-test boreas_io-test
cli-test cpeutils-test cvss-test ping-test sniffer-test util-test networking-test
passwordbasedauthentication-test xmlutils-test version-test osp-test
nvti-test hosts-test jsonpull-test)
passwordbasedauthentication-test xmlutils-test version-test osp-test
versionutils-test nvti-test hosts-test jsonpull-test)

endif (BUILD_TESTS AND NOT SKIP_SRC)

Expand Down
22 changes: 20 additions & 2 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ include_directories (${GLIB_INCLUDE_DIRS} ${GPGME_INCLUDE_DIRS} ${GCRYPT_INCLUDE
${LIBXML2_INCLUDE_DIRS})

set (FILES cpeutils.c passwordbasedauthentication.c compressutils.c fileutils.c gpgmeutils.c kb.c ldaputils.c
nvticache.c mqtt.c radiusutils.c serverutils.c sshutils.c uuidutils.c
nvticache.c mqtt.c radiusutils.c serverutils.c sshutils.c uuidutils.c versionutils.c
xmlutils.c jsonpull.c)

set (HEADERS cpeutils.h passwordbasedauthentication.h authutils.h compressutils.h fileutils.h gpgmeutils.h kb.h
ldaputils.h nvticache.h mqtt.h radiusutils.h serverutils.h sshutils.h
uuidutils.h xmlutils.h jsonpull.h)
uuidutils.h xmlutils.h jsonpull.h versionutils.h)

if (BUILD_STATIC)
add_library (gvm_util_static STATIC ${FILES})
Expand Down Expand Up @@ -198,6 +198,24 @@ if (BUILD_TESTS)
add_custom_target (tests-cpeutils
DEPENDS cpeutils-test)

add_executable (versionutils-test
EXCLUDE_FROM_ALL
versionutils_tests.c)

add_test (versionutils-test versionutils-test)

target_include_directories (versionutils-test PRIVATE ${CGREEN_INCLUDE_DIRS})

target_link_libraries (versionutils-test ${CGREEN_LIBRARIES}
${GLIB_LDFLAGS} ${GIO_LDFLAGS} ${GPGME_LDFLAGS} ${ZLIB_LDFLAGS}
${RADIUS_LDFLAGS} ${LIBSSH_LDFLAGS} ${GNUTLS_LDFLAGS}
${GCRYPT_LDFLAGS} ${LDAP_LDFLAGS} ${REDIS_LDFLAGS}
${LIBXML2_LDFLAGS} ${UUID_LDFLAGS}
${LINKER_HARDENING_FLAGS})

add_custom_target (tests-versionutils
DEPENDS versionutils-test)

add_executable (xmlutils-test
EXCLUDE_FROM_ALL
xmlutils_tests.c)
Expand Down
2 changes: 2 additions & 0 deletions util/cpeutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* CPE or the CPE 2.3 formatted string binding of a CPE into a CPE struct
* that corresponds to the WFN naming of a CPE. Further functions to convert
* the CPE struct into the different bindings are provided.
* This file also contains a function that checks if one CPE (represented in a
* CPE struct) is a match for an other CPE (also represented in a CPE struct).
*/

#include "cpeutils.h"
Expand Down
Loading
Loading