Skip to content

Commit

Permalink
feat(checker): add linuxptp 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 20, 2024
1 parent 2b15bc5 commit cbfe958
Show file tree
Hide file tree
Showing 6 changed files with 49 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 @@ -213,6 +213,7 @@
"libyaml",
"lighttpd",
"linux_kernel",
"linuxptp",
"lldpd",
"logrotate",
"lrzip",
Expand Down
22 changes: 22 additions & 0 deletions cve_bin_tool/checkers/linuxptp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for linuxptp
https://www.cvedetails.com/product/98135/Linuxptp-Project-Linuxptp.html?vendor_id=24927
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class LinuxptpChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"(?:ptp|PTP)[A-Za-z0-9_:% \[\]\-\.\r\n]*\r?\n([0-9]\.[0-9])\r?\n"
]
VENDOR_PRODUCT = [("linuxptp_project", "linuxptp")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions test/test_data/linuxptp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "linuxptp", "version": "3.1", "version_strings": ["ptp\n3.1"]}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
"package_name": "linuxptp-4.4-2.fc42.aarch64.rpm",
"product": "linuxptp",
"version": "4.4",
},
{
"url": "http://ftp.debian.org/debian/pool/main/l/linuxptp/",
"package_name": "linuxptp_3.1-2.1_amd64.deb",
"product": "linuxptp",
"version": "3.1",
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "linuxptp_2.0-3_x86_64.ipk",
"product": "linuxptp",
"version": "2.0",
},
]

0 comments on commit cbfe958

Please sign in to comment.