diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 98ef612cf9..08ff056d17 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -64,6 +64,7 @@ "ffmpeg", "file", "firefox", + "flac", "freeradius", "freerdp", "fribidi", diff --git a/cve_bin_tool/checkers/flac.py b/cve_bin_tool/checkers/flac.py new file mode 100644 index 0000000000..f5d80be4e8 --- /dev/null +++ b/cve_bin_tool/checkers/flac.py @@ -0,0 +1,24 @@ +# Copyright (C) 2022 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for flac: + +https://www.cvedetails.com/product/12329/Flac-Libflac.html?vendor_id=7327 +https://www.cvedetails.com/product/46017/Flac-Project-Flac.html?vendor_id=17957 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class FlacChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [ + r"flac-([0-9]+\.[0-9]+\.[0-9]+)", + r"reference libFLAC ([0-9]+\.[0-9]+\.[0-9]+)", + ] + VENDOR_PRODUCT = [("flac", "libflac"), ("flac_project", "flac")] diff --git a/test/condensed-downloads/flac-1.4.2-1.fc38.aarch64.rpm.tar.gz b/test/condensed-downloads/flac-1.4.2-1.fc38.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..2e32710515 Binary files /dev/null and b/test/condensed-downloads/flac-1.4.2-1.fc38.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/libflac8_1.3.0-3_amd64.deb.tar.gz b/test/condensed-downloads/libflac8_1.3.0-3_amd64.deb.tar.gz new file mode 100644 index 0000000000..7e0739003e Binary files /dev/null and b/test/condensed-downloads/libflac8_1.3.0-3_amd64.deb.tar.gz differ diff --git a/test/condensed-downloads/libflac_1.3.3-1_x86_64.ipk.tar.gz b/test/condensed-downloads/libflac_1.3.3-1_x86_64.ipk.tar.gz new file mode 100644 index 0000000000..b4df2b72d9 Binary files /dev/null and b/test/condensed-downloads/libflac_1.3.3-1_x86_64.ipk.tar.gz differ diff --git a/test/test_data/flac.py b/test/test_data/flac.py new file mode 100644 index 0000000000..4dead22efa --- /dev/null +++ b/test/test_data/flac.py @@ -0,0 +1,31 @@ +# Copyright (C) 2022 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "flac", "version": "1.4.2", "version_strings": ["flac-1.4.2"]}, + { + "product": "flac", + "version": "1.3.0", + "version_strings": ["reference libFLAC 1.3.0"], + }, +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/f/", + "package_name": "flac-1.4.2-1.fc38.aarch64.rpm", + "product": "flac", + "version": "1.4.2", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/f/flac/", + "package_name": "libflac8_1.3.0-3_amd64.deb", + "product": "flac", + "version": "1.3.0", + }, + { + "url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/", + "package_name": "libflac_1.3.3-1_x86_64.ipk", + "product": "flac", + "version": "1.3.3", + }, +]