Skip to content

Commit 9fc71f1

Browse files
authored
feat(checker): add libtasn1 checker (#3000)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 8a514c1 commit 9fc71f1

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
"libsrtp",
160160
"libssh",
161161
"libssh2",
162+
"libtasn1",
162163
"libtiff",
163164
"libtomcrypt",
164165
"libupnp",

cve_bin_tool/checkers/libtasn1.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 libtasn1
7+
8+
https://www.cvedetails.com/product/3620/Free-Software-Foundation-Inc.-Libtasn1.html?vendor_id=2125
9+
https://www.cvedetails.com/product/22173/GNU-Libtasn1.html?vendor_id=72
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class Libtasn1Checker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [r"ASSIGNMENT,[a-zA-Z:\r\n]*\r?\n([0-9]+\.[0-9]+(\.[0-9]+)?)"]
21+
VENDOR_PRODUCT = [
22+
("free_software_foundation_inc.", "libtasn1"),
23+
("gnu", "libtasn1"),
24+
]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/libtasn1.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "libtasn1",
7+
"version": "4.15.0",
8+
"version_strings": ["ASSIGNMENT,\n4.15.0"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
14+
"package_name": "libtasn1-4.19.0-2.fc38.aarch64.rpm",
15+
"product": "libtasn1",
16+
"version": "4.19.0",
17+
},
18+
{
19+
"url": "http://ftp.fr.debian.org/debian/pool/main/libt/libtasn1-6/",
20+
"package_name": "libtasn1-6_4.13-3_arm64.deb",
21+
"product": "libtasn1",
22+
"version": "4.13",
23+
},
24+
{
25+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
26+
"package_name": "libtasn1_4.15.0-1_x86_64.ipk",
27+
"product": "libtasn1",
28+
"version": "4.15.0",
29+
},
30+
]

0 commit comments

Comments
 (0)