diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 3a147853cf..562c0744f3 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -149,6 +149,7 @@ "libcurl", "libdb", "libebml", + "libevent", "libexpat", "libgcrypt", "libgd", diff --git a/cve_bin_tool/checkers/libevent.py b/cve_bin_tool/checkers/libevent.py new file mode 100644 index 0000000000..98c7d872f1 --- /dev/null +++ b/cve_bin_tool/checkers/libevent.py @@ -0,0 +1,24 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for libevent: + +https://www.cvedetails.com/product/10398/Niels-Provos-Libevent.html?vendor_id=2382 +https://www.cvedetails.com/product/32303/Libevent-Project-Libevent.html?vendor_id=15590 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class LibeventChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [ + r"libevent using: %s[a-zA-Z%:. \r\n]*([0-9]+\.[0-9]+\.[0-9]+)-stable", + r"([0-9]+\.[0-9]+\.[0-9]+)-stable[0-9a-zA-Z|~,;!&+=*%_<>():'. \[\]\-\r\n]*libevent using:", + ] + VENDOR_PRODUCT = [("libevent_project", "libevent"), ("niels_provos", "libevent")] diff --git a/test/condensed-downloads/libevent-2.0-5_2.0.21-stable-3_amd64.deb.tar.gz b/test/condensed-downloads/libevent-2.0-5_2.0.21-stable-3_amd64.deb.tar.gz new file mode 100644 index 0000000000..71d7309c2a Binary files /dev/null and b/test/condensed-downloads/libevent-2.0-5_2.0.21-stable-3_amd64.deb.tar.gz differ diff --git a/test/condensed-downloads/libevent-2.1.12-7.fc37.aarch64.rpm.tar.gz b/test/condensed-downloads/libevent-2.1.12-7.fc37.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..789102699c Binary files /dev/null and b/test/condensed-downloads/libevent-2.1.12-7.fc37.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/libevent2-7_2.1.11-1_x86_64.ipk.tar.gz b/test/condensed-downloads/libevent2-7_2.1.11-1_x86_64.ipk.tar.gz new file mode 100644 index 0000000000..cedb8d2dd0 Binary files /dev/null and b/test/condensed-downloads/libevent2-7_2.1.11-1_x86_64.ipk.tar.gz differ diff --git a/test/test_data/libevent.py b/test/test_data/libevent.py new file mode 100644 index 0000000000..ae0f6ebe95 --- /dev/null +++ b/test/test_data/libevent.py @@ -0,0 +1,30 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + { + "product": "libevent", + "version": "2.0.21", + "version_strings": ["2.0.21-stable\nlibevent using:"], + }, +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/", + "package_name": "libevent-2.1.12-7.fc37.aarch64.rpm", + "product": "libevent", + "version": "2.1.12", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/libe/libevent/", + "package_name": "libevent-2.0-5_2.0.21-stable-3_amd64.deb", + "product": "libevent", + "version": "2.0.21", + }, + { + "url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/", + "package_name": "libevent2-7_2.1.11-1_x86_64.ipk", + "product": "libevent", + "version": "2.1.11", + }, +]