diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index ba57b241fb..ffb0c2e700 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -56,6 +56,7 @@ "chess", "chrony", "civetweb", + "clang", "clamav", "collectd", "commons_compress", diff --git a/cve_bin_tool/checkers/clang.py b/cve_bin_tool/checkers/clang.py new file mode 100644 index 0000000000..9b14d6c3c0 --- /dev/null +++ b/cve_bin_tool/checkers/clang.py @@ -0,0 +1,20 @@ +# Copyright (C) 2025 Keysight Technologies +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for clang + +https://www.cvedetails.com/product/27514/Llvm-Clang.html?vendor_id=13260 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class ClangChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"Clang ([0-9]+\.[0-9]+\.[0-9]+)"] + VENDOR_PRODUCT = [("llvm", "clang")] diff --git a/test/condensed-downloads/libclang1-19_19.1.1-1ubuntu1_amd64.deb.tar.gz b/test/condensed-downloads/libclang1-19_19.1.1-1ubuntu1_amd64.deb.tar.gz new file mode 100644 index 0000000000..4263474e8c Binary files /dev/null and b/test/condensed-downloads/libclang1-19_19.1.1-1ubuntu1_amd64.deb.tar.gz differ diff --git a/test/test_data/clamav.py b/test/test_data/clamav.py index 829ac25d29..4fad47c57c 100644 --- a/test/test_data/clamav.py +++ b/test/test_data/clamav.py @@ -17,14 +17,14 @@ "package_name": "clamav-0.105.1-1-omv4090.aarch64.rpm", "product": "clamav", "version": "0.105.1", - "other_products": ["rust"], + "other_products": ["rust", "clang"], }, { "url": "http://rpmfind.net/linux/openmandriva/cooker/repository/x86_64/main/release/", "package_name": "clamav-0.105.1-1-omv4090.x86_64.rpm", "product": "clamav", "version": "0.105.1", - "other_products": ["rust"], + "other_products": ["rust", "clang"], }, { "url": "http://ftp.debian.org/debian/pool/main/c/clamav/", diff --git a/test/test_data/clang.py b/test/test_data/clang.py new file mode 100644 index 0000000000..0612a674f5 --- /dev/null +++ b/test/test_data/clang.py @@ -0,0 +1,18 @@ +# Copyright (C) 2025 Keysight Technologies +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + { + "product": "clang", + "version": "7.0.0", + "version_strings": ["Clang 7.0.0"], + } +] +package_test_data = [ + { + "url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-19/", + "package_name": "libclang1-19_19.1.1-1ubuntu1_amd64.deb", + "product": "clang", + "version": "19.1.1", + }, +] diff --git a/test/test_data/dotnet.py b/test/test_data/dotnet.py index 92944b53f1..0f99d7ba13 100644 --- a/test/test_data/dotnet.py +++ b/test/test_data/dotnet.py @@ -12,5 +12,6 @@ "product": ".net", "version": "7.0.11", "package_name": "dotnet-runtime-7.0-7.0.11-1.fc39.aarch64.rpm", + "other_products": ["clang"], }, ]