diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index bcdac8bd8c..6f8c99023a 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -141,6 +141,7 @@ "i2pd", "icecast", "icu", + "indent", "iperf3", "ipmitool", "ipsec_tools", diff --git a/cve_bin_tool/checkers/indent.py b/cve_bin_tool/checkers/indent.py new file mode 100644 index 0000000000..5bdffc6e48 --- /dev/null +++ b/cve_bin_tool/checkers/indent.py @@ -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")] diff --git a/test/condensed-downloads/indent-2.2.12-r0.apk.tar.gz b/test/condensed-downloads/indent-2.2.12-r0.apk.tar.gz new file mode 100644 index 0000000000..b1784722c8 Binary files /dev/null and b/test/condensed-downloads/indent-2.2.12-r0.apk.tar.gz differ diff --git a/test/condensed-downloads/indent-2.2.13-9.fc42.aarch64.rpm.tar.gz b/test/condensed-downloads/indent-2.2.13-9.fc42.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..a9ee00d90a Binary files /dev/null and b/test/condensed-downloads/indent-2.2.13-9.fc42.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/indent_2.2.12-1_amd64.deb.tar.gz b/test/condensed-downloads/indent_2.2.12-1_amd64.deb.tar.gz new file mode 100644 index 0000000000..ee32341898 Binary files /dev/null and b/test/condensed-downloads/indent_2.2.12-1_amd64.deb.tar.gz differ diff --git a/test/test_data/indent.py b/test/test_data/indent.py new file mode 100644 index 0000000000..157c0a5f74 --- /dev/null +++ b/test/test_data/indent.py @@ -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", + }, +]