Skip to content

Commit b94d922

Browse files
authored
feat(checker): add bluez checker (#2975)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent f5a2316 commit b94d922

File tree

6 files changed

+58
-0
lines changed

6 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
@@ -28,6 +28,7 @@
2828
"binutils",
2929
"bird",
3030
"bison",
31+
"bluez",
3132
"boinc",
3233
"botan",
3334
"bro",

cve_bin_tool/checkers/bluez.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 bluez
7+
8+
https://www.cvedetails.com/product/35116/Bluez-Bluez.html?vendor_id=8316
9+
https://www.cvedetails.com/product/35329/Bluez-Project-Bluez.html?vendor_id=3242
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class BluezChecker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [
21+
r"bluez-([0-9]+\.[0-9]+)",
22+
r"([0-9]+\.[0-9]+)\r?\n[a-zA-Z :]*(?:BlueZ|hcidump|hcitool|OBEX daemon)",
23+
]
24+
VENDOR_PRODUCT = [("bluez", "bluez"), ("bluez_project", "bluez")]
171 KB
Binary file not shown.
205 KB
Binary file not shown.
752 KB
Binary file not shown.

test/test_data/bluez.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "bluez", "version": "5.28", "version_strings": ["bluez-5.28"]},
6+
{
7+
"product": "bluez",
8+
"version": "5.50",
9+
"version_strings": ["5.50\nUsage: hcidump"],
10+
},
11+
{"product": "bluez", "version": "5.50", "version_strings": ["5.50\nhcitool"]},
12+
{"product": "bluez", "version": "5.66", "version_strings": ["5.66\nBlueZ"]},
13+
]
14+
package_test_data = [
15+
{
16+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/b/",
17+
"package_name": "bluez-5.66-5.fc38.aarch64.rpm",
18+
"product": "bluez",
19+
"version": "5.66",
20+
},
21+
{
22+
"url": "http://ftp.fr.debian.org/debian/pool/main/b/bluez/",
23+
"package_name": "bluez_5.50-1.2~deb10u2_amd64.deb",
24+
"product": "bluez",
25+
"version": "5.50",
26+
},
27+
{
28+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
29+
"package_name": "bluez-daemon_5.50-5_x86_64.ipk",
30+
"product": "bluez",
31+
"version": "5.50",
32+
},
33+
]

0 commit comments

Comments
 (0)