Skip to content

Commit 7e0cb95

Browse files
ffontaineinosmeet
authored andcommitted
feat(checker): add mbedtls checker (intel#3619)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 82541c3 commit 7e0cb95

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
"lz4",
200200
"mailx",
201201
"mariadb",
202+
"mbedtls",
202203
"mdadm",
203204
"memcached",
204205
"minetest",

cve_bin_tool/checkers/mbedtls.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for mbedtls
7+
8+
https://www.cvedetails.com/product/32568/ARM-Mbed-Tls.html?vendor_id=15698
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class MbedtlsChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"[m|M]bed TLS ([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("arm", "mbed_tls")]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/mbedtls.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "mbed_tls",
7+
"version": "2.16.0",
8+
"version_strings": ["mbed TLS 2.16.0"],
9+
},
10+
{
11+
"product": "mbed_tls",
12+
"version": "2.28.5",
13+
"version_strings": ["Mbed TLS 2.28.5"],
14+
},
15+
]
16+
package_test_data = [
17+
{
18+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/m/",
19+
"package_name": "mbedtls-2.28.5-1.fc40.aarch64.rpm",
20+
"product": "mbed_tls",
21+
"version": "2.28.5",
22+
},
23+
{
24+
"url": "http://ftp.fr.debian.org/debian/pool/main/m/mbedtls/",
25+
"package_name": "libmbedcrypto3_2.16.0-1_amd64.deb",
26+
"product": "mbed_tls",
27+
"version": "2.16.0",
28+
},
29+
{
30+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
31+
"package_name": "mbedtls-2.16.9-r0.apk",
32+
"product": "mbed_tls",
33+
"version": "2.16.9",
34+
},
35+
]

test/test_data/shadowsocks_libev.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@
3131
"package_name": "libshadowsocks-libev2_2.6.3+ds-3+deb9u1_amd64.deb",
3232
"product": "shadowsocks-libev",
3333
"version": "2.6.3",
34+
"other_products": ["mbed_tls"],
3435
},
3536
{
3637
"url": "http://ftp.fr.debian.org/debian/pool/main/s/shadowsocks-libev/",
3738
"package_name": "libshadowsocks-libev2_2.6.3+ds-3+deb9u1_arm64.deb",
3839
"product": "shadowsocks-libev",
3940
"version": "2.6.3",
41+
"other_products": ["mbed_tls"],
4042
},
4143
{
4244
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",

0 commit comments

Comments
 (0)