Skip to content

Commit 43139e8

Browse files
authored
feat(checker): add cpp-httplib checker (#4522)
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
1 parent 1e2dff8 commit 43139e8

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

cve_bin_tool/checkers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"connman",
6060
"coreutils",
6161
"cpio",
62+
"cpp_httplib",
6263
"cronie",
6364
"cryptsetup",
6465
"cups",

cve_bin_tool/checkers/cpp_httplib.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for cpp-httplib
7+
8+
https://www.cvedetails.com/product/83519/Cpp-httplib-Project-Cpp-httplib.html?vendor_id=23214
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class CppHttplibChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"cpp-httplib/\r?\n([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("cpp-httplib_project", "cpp-httplib")]
Binary file not shown.
Binary file not shown.

test/test_data/cpp_httplib.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "cpp-httplib",
7+
"version": "0.11.4",
8+
"version_strings": ["cpp-httplib/\n0.11.4"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/opensuse/distribution/leap/15.6/repo/oss/aarch64/",
14+
"package_name": "libcpp-httplib0_12-0.12.5-bp156.1.7.aarch64.rpm",
15+
"product": "cpp-httplib",
16+
"version": "0.12.5",
17+
},
18+
{
19+
"url": "http://ftp.debian.org/debian/pool/main/c/cpp-httplib/",
20+
"package_name": "libcpp-httplib0.11_0.11.4+ds-1+deb12u1_amd64.deb",
21+
"product": "cpp-httplib",
22+
"version": "0.11.4",
23+
},
24+
]

0 commit comments

Comments
 (0)