Skip to content

Commit

Permalink
feat(checker): add indent checker (intel#4774)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine authored Feb 6, 2025
1 parent dea16ca commit 2e62be3
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 @@ -141,6 +141,7 @@
"i2pd",
"icecast",
"icu",
"indent",
"iperf3",
"ipmitool",
"ipsec_tools",
Expand Down
22 changes: 22 additions & 0 deletions cve_bin_tool/checkers/indent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for indent
https://www.cvedetails.com/product/157667/GNU-Indent.html?vendor_id=72
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class IndentChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"GNU indent[a-zA-Z0-9_%/+:`' \"\(\)\-\.\r\n]*([0-9]+\.[0-9]+\.[0-9]+)"
]
VENDOR_PRODUCT = [("gnu", "indent")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions test/test_data/indent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "indent", "version": "2.2.12", "version_strings": ["GNU indent 2.2.12"]}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/i/",
"package_name": "indent-2.2.13-9.fc42.aarch64.rpm",
"product": "indent",
"version": "2.2.13",
},
{
"url": "http://ftp.debian.org/debian/pool/main/i/indent/",
"package_name": "indent_2.2.12-1_amd64.deb",
"product": "indent",
"version": "2.2.12",
},
{
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
"package_name": "indent-2.2.12-r0.apk",
"product": "indent",
"version": "2.2.12",
},
]

0 comments on commit 2e62be3

Please sign in to comment.