Skip to content

Commit aa60bfe

Browse files
authored
feat(checker): add tesseract checker (#3570)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent a255140 commit aa60bfe

File tree

6 files changed

+51
-0
lines changed

6 files changed

+51
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@
310310
"tcpdump",
311311
"tcpreplay",
312312
"terminology",
313+
"tesseract",
313314
"thrift",
314315
"thttpd",
315316
"thunderbird",

cve_bin_tool/checkers/tesseract.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for tesseract
7+
8+
https://www.cvedetails.com/product/62309/Tesseract-Project-Tesseract.html?vendor_id=21055
9+
https://www.cvedetails.com/product/97901/Tesseract-Ocr-Project-Tesseract-Ocr.html?vendor_id=24900
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class TesseractChecker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [r"tesseract ([0-9]+\.[0-9]+\.[0-9]+)"]
21+
VENDOR_PRODUCT = [
22+
("tesseract_project", "tesseract"),
23+
("tesseract_ocr_project", "tesseract_ocr"),
24+
]
549 KB
Binary file not shown.
190 KB
Binary file not shown.
562 KB
Binary file not shown.

test/test_data/tesseract.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "tesseract", "version": "4.0.0", "version_strings": ["tesseract 4.0.0"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/t/",
10+
"package_name": "tesseract-5.3.3-1.fc40.aarch64.rpm",
11+
"product": "tesseract",
12+
"version": "5.3.3",
13+
},
14+
{
15+
"url": "http://ftp.fr.debian.org/debian/pool/main/t/tesseract/",
16+
"package_name": "libtesseract4_4.0.0-2_amd64.deb",
17+
"product": "tesseract",
18+
"version": "4.0.0",
19+
},
20+
{
21+
"url": "https://downloads.openwrt.org/releases/21.02.0/packages/x86_64/packages/",
22+
"package_name": "tesseract_4.0.0-2_x86_64.ipk",
23+
"product": "tesseract",
24+
"version": "4.0.0",
25+
},
26+
]

0 commit comments

Comments
 (0)