Skip to content

Commit fbcbbd6

Browse files
authored
feat(checker): add libevent checker (#3587)
Replace #1027, #1124, #2501 and #2760 Close #977 Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9923fe1 commit fbcbbd6

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
"libcurl",
150150
"libdb",
151151
"libebml",
152+
"libevent",
152153
"libexpat",
153154
"libgcrypt",
154155
"libgd",

cve_bin_tool/checkers/libevent.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for libevent:
7+
8+
https://www.cvedetails.com/product/10398/Niels-Provos-Libevent.html?vendor_id=2382
9+
https://www.cvedetails.com/product/32303/Libevent-Project-Libevent.html?vendor_id=15590
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class LibeventChecker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [
21+
r"libevent using: %s[a-zA-Z%:. \r\n]*([0-9]+\.[0-9]+\.[0-9]+)-stable",
22+
r"([0-9]+\.[0-9]+\.[0-9]+)-stable[0-9a-zA-Z|~,;!&+=*%_<>():'. \[\]\-\r\n]*libevent using:",
23+
]
24+
VENDOR_PRODUCT = [("libevent_project", "libevent"), ("niels_provos", "libevent")]
76.6 KB
Binary file not shown.
35.6 KB
Binary file not shown.
57 KB
Binary file not shown.

test/test_data/libevent.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "libevent",
7+
"version": "2.0.21",
8+
"version_strings": ["2.0.21-stable\nlibevent using:"],
9+
},
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
14+
"package_name": "libevent-2.1.12-7.fc37.aarch64.rpm",
15+
"product": "libevent",
16+
"version": "2.1.12",
17+
},
18+
{
19+
"url": "http://ftp.fr.debian.org/debian/pool/main/libe/libevent/",
20+
"package_name": "libevent-2.0-5_2.0.21-stable-3_amd64.deb",
21+
"product": "libevent",
22+
"version": "2.0.21",
23+
},
24+
{
25+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/",
26+
"package_name": "libevent2-7_2.1.11-1_x86_64.ipk",
27+
"product": "libevent",
28+
"version": "2.1.11",
29+
},
30+
]

0 commit comments

Comments
 (0)