Skip to content

Commit

Permalink
feat(checker): add jasper checker (#4378)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine authored Aug 23, 2024
1 parent eb8da07 commit fa6da29
Show file tree
Hide file tree
Showing 5 changed files with 46 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 @@ -146,6 +146,7 @@
"jack2",
"jacksondatabind",
"janus",
"jasper",
"jhead",
"jq",
"json_c",
Expand Down
23 changes: 23 additions & 0 deletions cve_bin_tool/checkers/jasper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for jasper
https://www.cvedetails.com/product/15057/Jasper-Project-Jasper.html?vendor_id=8582
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class JasperChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"([0-9]+\.[0-9]+\.[0-9]+)[a-z%: \[\]\-\r\n]*libjasper",
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nJasPer",
]
VENDOR_PRODUCT = [("jasper_project", "jasper")]
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions test/test_data/jasper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "jasper", "version": "3.0.6", "version_strings": ["3.0.6\nlibjasper"]},
{"product": "jasper", "version": "4.2.3", "version_strings": ["4.2.3\nJasPer"]},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/releases/39/Everything/x86_64/os/Packages/j/",
"package_name": "jasper-3.0.6-4.fc39.x86_64.rpm",
"product": "jasper",
"version": "3.0.6",
},
{
"url": "https://eu.mirror.archlinuxarm.org/aarch64/extra/",
"package_name": "jasper-4.2.4-1-aarch64.pkg.tar.xz",
"product": "jasper",
"version": "4.2.4",
"other_products": ["gcc"],
},
]

0 comments on commit fa6da29

Please sign in to comment.