diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 4bb2b1bfb0..dcb9ddd17c 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -133,6 +133,7 @@ "libarchive", "libass", "libbpg", + "libcoap", "libconfuse", "libdb", "libebml", diff --git a/cve_bin_tool/checkers/libcoap.py b/cve_bin_tool/checkers/libcoap.py new file mode 100644 index 0000000000..7a9242c227 --- /dev/null +++ b/cve_bin_tool/checkers/libcoap.py @@ -0,0 +1,20 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for libcoap: + +https://www.cvedetails.com/product/143502/Libcoap-Libcoap.html?vendor_id=31037 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class LibcoapChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"libcoap ([0-9]+\.[0-9]+\.[0-9]+)"] + VENDOR_PRODUCT = [("libcoap", "libcoap")] diff --git a/test/condensed-downloads/libcoap-1-0_4.1.2-1_amd64.deb.tar.gz b/test/condensed-downloads/libcoap-1-0_4.1.2-1_amd64.deb.tar.gz new file mode 100644 index 0000000000..307c3f69f1 Binary files /dev/null and b/test/condensed-downloads/libcoap-1-0_4.1.2-1_amd64.deb.tar.gz differ diff --git a/test/condensed-downloads/libcoap-4.3.2-0.1.rc1.fc39.aarch64.rpm.tar.gz b/test/condensed-downloads/libcoap-4.3.2-0.1.rc1.fc39.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..0a0a25a53d Binary files /dev/null and b/test/condensed-downloads/libcoap-4.3.2-0.1.rc1.fc39.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/libcoap2_4.2.1-1_x86_64.ipk.tar.gz b/test/condensed-downloads/libcoap2_4.2.1-1_x86_64.ipk.tar.gz new file mode 100644 index 0000000000..63986cd451 Binary files /dev/null and b/test/condensed-downloads/libcoap2_4.2.1-1_x86_64.ipk.tar.gz differ diff --git a/test/condensed-downloads/libcoap3_4.3.1-1_amd64.deb.tar.gz b/test/condensed-downloads/libcoap3_4.3.1-1_amd64.deb.tar.gz new file mode 100644 index 0000000000..0b33449ecd Binary files /dev/null and b/test/condensed-downloads/libcoap3_4.3.1-1_amd64.deb.tar.gz differ diff --git a/test/test_data/libcoap.py b/test/test_data/libcoap.py new file mode 100644 index 0000000000..7896d46405 --- /dev/null +++ b/test/test_data/libcoap.py @@ -0,0 +1,33 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "libcoap", "version": "4.3.1", "version_strings": ["libcoap 4.3.1"]} +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/", + "package_name": "libcoap-4.3.2-0.1.rc1.fc39.aarch64.rpm", + "product": "libcoap", + "version": "4.3.2", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/libc/libcoap/", + "package_name": "libcoap-1-0_4.1.2-1_amd64.deb", + "product": "libcoap", + "version": "4.1.2", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/libc/libcoap3/", + "package_name": "libcoap3_4.3.1-1_amd64.deb", + "product": "libcoap", + "version": "4.3.1", + "other_products": ["gnutls"], + }, + { + "url": "https://downloads.openwrt.org/releases/packages-21.02/x86_64/packages/", + "package_name": "libcoap2_4.2.1-1_x86_64.ipk", + "product": "libcoap", + "version": "4.2.1", + }, +]