Skip to content

Commit fa6da29

Browse files
authored
feat(checker): add jasper checker (#4378)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent eb8da07 commit fa6da29

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
"jack2",
147147
"jacksondatabind",
148148
"janus",
149+
"jasper",
149150
"jhead",
150151
"jq",
151152
"json_c",

cve_bin_tool/checkers/jasper.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for jasper
7+
8+
https://www.cvedetails.com/product/15057/Jasper-Project-Jasper.html?vendor_id=8582
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class JasperChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"([0-9]+\.[0-9]+\.[0-9]+)[a-z%: \[\]\-\r\n]*libjasper",
21+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nJasPer",
22+
]
23+
VENDOR_PRODUCT = [("jasper_project", "jasper")]
3.75 KB
Binary file not shown.
21.4 KB
Binary file not shown.

test/test_data/jasper.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "jasper", "version": "3.0.6", "version_strings": ["3.0.6\nlibjasper"]},
6+
{"product": "jasper", "version": "4.2.3", "version_strings": ["4.2.3\nJasPer"]},
7+
]
8+
package_test_data = [
9+
{
10+
"url": "http://rpmfind.net/linux/fedora/linux/releases/39/Everything/x86_64/os/Packages/j/",
11+
"package_name": "jasper-3.0.6-4.fc39.x86_64.rpm",
12+
"product": "jasper",
13+
"version": "3.0.6",
14+
},
15+
{
16+
"url": "https://eu.mirror.archlinuxarm.org/aarch64/extra/",
17+
"package_name": "jasper-4.2.4-1-aarch64.pkg.tar.xz",
18+
"product": "jasper",
19+
"version": "4.2.4",
20+
"other_products": ["gcc"],
21+
},
22+
]

0 commit comments

Comments
 (0)