Skip to content

Commit

Permalink
feat(checker): add libevent checker
Browse files Browse the repository at this point in the history
Replace intel#1027, intel#1124, intel#2501 and intel#2760
Close intel#977

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Dec 13, 2023
1 parent 9923fe1 commit 965075e
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"libcurl",
"libdb",
"libebml",
"libevent",
"libexpat",
"libgcrypt",
"libgd",
Expand Down
24 changes: 24 additions & 0 deletions cve_bin_tool/checkers/libevent.py
Original file line number Diff line number Diff line change
@@ -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")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions test/test_data/libevent.py
Original file line number Diff line number Diff line change
@@ -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",
},
]

0 comments on commit 965075e

Please sign in to comment.