diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 352f28841b..e7d7ea57a5 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -103,6 +103,7 @@ "gnutls", "glib", "glibc", + "go", "gpgme", "gpsd", "graphicsmagick", diff --git a/cve_bin_tool/checkers/go.py b/cve_bin_tool/checkers/go.py new file mode 100644 index 0000000000..ed1bd0e780 --- /dev/null +++ b/cve_bin_tool/checkers/go.py @@ -0,0 +1,20 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for go + +https://www.cvedetails.com/product/29205/Golang-GO.html?vendor_id=14185 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class GoChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"go([0-9]+\.[0-9]+\.[0-9]+)"] + VENDOR_PRODUCT = [("golang", "go")] diff --git a/test/condensed-downloads/go-1.13.13-r0.apk.tar.gz b/test/condensed-downloads/go-1.13.13-r0.apk.tar.gz new file mode 100644 index 0000000000..f11cac71f8 Binary files /dev/null and b/test/condensed-downloads/go-1.13.13-r0.apk.tar.gz differ diff --git a/test/condensed-downloads/golang-1.11-go_1.11.6-1+deb10u4_amd64.deb.tar.gz b/test/condensed-downloads/golang-1.11-go_1.11.6-1+deb10u4_amd64.deb.tar.gz new file mode 100644 index 0000000000..f7f16e1ca8 Binary files /dev/null and b/test/condensed-downloads/golang-1.11-go_1.11.6-1+deb10u4_amd64.deb.tar.gz differ diff --git a/test/condensed-downloads/golang_1.13.15-1_x86_64.ipk.tar.gz b/test/condensed-downloads/golang_1.13.15-1_x86_64.ipk.tar.gz new file mode 100644 index 0000000000..aa5c725a95 Binary files /dev/null and b/test/condensed-downloads/golang_1.13.15-1_x86_64.ipk.tar.gz differ diff --git a/test/test_data/go.py b/test/test_data/go.py new file mode 100644 index 0000000000..1264cb8ff0 --- /dev/null +++ b/test/test_data/go.py @@ -0,0 +1,26 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "go", "version": "1.11.6", "version_strings": ["go1.11.6"]} +] +package_test_data = [ + { + "url": "http://ftp.fr.debian.org/debian/pool/main/g/golang-1.11/", + "package_name": "golang-1.11-go_1.11.6-1+deb10u4_amd64.deb", + "product": "go", + "version": "1.11.6", + }, + { + "url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/", + "package_name": "golang_1.13.15-1_x86_64.ipk", + "product": "go", + "version": "1.13.15", + }, + { + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/", + "package_name": "go-1.13.13-r0.apk", + "product": "go", + "version": "1.13.13", + }, +]