Skip to content

Commit

Permalink
feat(checker): add mbedtls checker
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Dec 18, 2023
1 parent 098a96f commit f08dab6
Show file tree
Hide file tree
Showing 7 changed files with 58 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 @@ -197,6 +197,7 @@
"lz4",
"mailx",
"mariadb",
"mbedtls",
"mdadm",
"memcached",
"minetest",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/mbedtls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for mbedtls
https://www.cvedetails.com/product/32568/ARM-Mbed-Tls.html?vendor_id=15698
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class MbedtlsChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"[m|M]bed TLS ([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("arm", "mbed_tls")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 35 additions & 0 deletions test/test_data/mbedtls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "mbed_tls",
"version": "2.16.0",
"version_strings": ["mbed TLS 2.16.0"],
},
{
"product": "mbed_tls",
"version": "2.28.5",
"version_strings": ["Mbed TLS 2.28.5"],
},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/m/",
"package_name": "mbedtls-2.28.5-1.fc40.aarch64.rpm",
"product": "mbed_tls",
"version": "2.28.5",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/m/mbedtls/",
"package_name": "libmbedcrypto3_2.16.0-1_amd64.deb",
"product": "mbed_tls",
"version": "2.16.0",
},
{
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
"package_name": "mbedtls-2.16.9-r0.apk",
"product": "mbed_tls",
"version": "2.16.9",
},
]
2 changes: 2 additions & 0 deletions test/test_data/shadowsocks_libev.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
"package_name": "libshadowsocks-libev2_2.6.3+ds-3+deb9u1_amd64.deb",
"product": "shadowsocks-libev",
"version": "2.6.3",
"other_products": ["mbed_tls"],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/s/shadowsocks-libev/",
"package_name": "libshadowsocks-libev2_2.6.3+ds-3+deb9u1_arm64.deb",
"product": "shadowsocks-libev",
"version": "2.6.3",
"other_products": ["mbed_tls"],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
Expand Down

0 comments on commit f08dab6

Please sign in to comment.