Skip to content

Commit

Permalink
feat(checker): add cpp-httplib checker
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Oct 27, 2024
1 parent 17dd101 commit b906ea7
Show file tree
Hide file tree
Showing 5 changed files with 45 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 @@ -59,6 +59,7 @@
"connman",
"coreutils",
"cpio",
"cpp_httplib",
"cronie",
"cryptsetup",
"cups",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/cpp_httplib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for cpp-httplib
https://www.cvedetails.com/product/83519/Cpp-httplib-Project-Cpp-httplib.html?vendor_id=23214
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class CppHttplibChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"cpp-httplib/\r?\n([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("cpp-httplib_project", "cpp-httplib")]
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions test/test_data/cpp_httplib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "cpp-httplib",
"version": "0.11.4",
"version_strings": ["cpp-httplib/\n0.11.4"],
}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/opensuse/distribution/leap/15.6/repo/oss/aarch64/",
"package_name": "libcpp-httplib0_12-0.12.5-bp156.1.7.aarch64.rpm",
"product": "cpp-httplib",
"version": "0.12.5",
},
{
"url": "http://ftp.debian.org/debian/pool/main/c/cpp-httplib/",
"package_name": "libcpp-httplib0.11_0.11.4+ds-1+deb12u1_amd64.deb",
"product": "cpp-httplib",
"version": "0.11.4",
},
]

0 comments on commit b906ea7

Please sign in to comment.