diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 084c6cf464..dbecb65372 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -77,6 +77,7 @@ "lighttpd", "logrotate", "lua", + "luajit", "mariadb", "mdadm", "memcached", diff --git a/cve_bin_tool/checkers/luajit.py b/cve_bin_tool/checkers/luajit.py new file mode 100644 index 0000000000..41c2994aa6 --- /dev/null +++ b/cve_bin_tool/checkers/luajit.py @@ -0,0 +1,18 @@ +# Copyright (C) 2022 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for luajit + +https://www.cvedetails.com/vulnerability-list/vendor_id-22486/Luajit.html + +""" +from cve_bin_tool.checkers import Checker + + +class LuajitChecker(Checker): + CONTAINS_PATTERNS = [] + FILENAME_PATTERNS = [r"lua", r"luajit"] + VERSION_PATTERNS = [r"LuaJIT ([0-9]+\.[0-9]+\.[0-9]+)"] + VENDOR_PRODUCT = [("luajit", "luajit")] diff --git a/test/condensed-downloads/libluajit-5_1-2-2.1.0~beta3+git.1647772157.43ebb949-1.2.x86_64.rpm.tar.gz b/test/condensed-downloads/libluajit-5_1-2-2.1.0~beta3+git.1647772157.43ebb949-1.2.x86_64.rpm.tar.gz new file mode 100644 index 0000000000..47257c4580 Binary files /dev/null and b/test/condensed-downloads/libluajit-5_1-2-2.1.0~beta3+git.1647772157.43ebb949-1.2.x86_64.rpm.tar.gz differ diff --git a/test/condensed-downloads/luajit_2.1.0~beta3+dfsg-6_arm64.deb.tar.gz b/test/condensed-downloads/luajit_2.1.0~beta3+dfsg-6_arm64.deb.tar.gz new file mode 100644 index 0000000000..31adc3f8b6 Binary files /dev/null and b/test/condensed-downloads/luajit_2.1.0~beta3+dfsg-6_arm64.deb.tar.gz differ diff --git a/test/test_data/luajit.py b/test/test_data/luajit.py new file mode 100644 index 0000000000..aec9b1e366 --- /dev/null +++ b/test/test_data/luajit.py @@ -0,0 +1,25 @@ +# Copyright (C) 2022 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + { + "product": "luajit", + "version": "2.1.0", + "version_strings": ["LuaJIT 2.1.0-beta3"], + }, +] + +package_test_data = [ + { + "url": "https://ftp.lysator.liu.se/pub/opensuse/tumbleweed/repo/oss/x86_64/", + "package_name": "libluajit-5_1-2-2.1.0~beta3+git.1647772157.43ebb949-1.2.x86_64.rpm", + "product": "luajit", + "version": "2.1.0", + }, + { + "url": "http://ports.ubuntu.com/pool/universe/l/luajit/", + "package_name": "luajit_2.1.0~beta3+dfsg-6_arm64.deb", + "product": "luajit", + "version": "2.1.0", + }, +]