Skip to content

Commit

Permalink
feat(checker): luajit checker (#1705)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine authored Jul 5, 2022
1 parent 6ae0d63 commit 9e205be
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"lighttpd",
"logrotate",
"lua",
"luajit",
"mariadb",
"mdadm",
"memcached",
Expand Down
18 changes: 18 additions & 0 deletions cve_bin_tool/checkers/luajit.py
Original file line number Diff line number Diff line change
@@ -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")]
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions test/test_data/luajit.py
Original file line number Diff line number Diff line change
@@ -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",
},
]

0 comments on commit 9e205be

Please sign in to comment.