From 6bec7bd69b90d82172e8dba65b2ef52049530e72 Mon Sep 17 00:00:00 2001 From: FReeshabh Date: Fri, 18 Oct 2019 01:37:39 -0500 Subject: [PATCH 1/3] Added the Bluez checker modified: checkers/__init__.py new file: checkers/bluez.py --- cve_bin_tool/checkers/__init__.py | 1 + cve_bin_tool/checkers/bluez.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 cve_bin_tool/checkers/bluez.py diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index afd111f635..4bb72e9a31 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -16,4 +16,5 @@ "sqlite", "kerberos", "icu", + "bluez", ] diff --git a/cve_bin_tool/checkers/bluez.py b/cve_bin_tool/checkers/bluez.py new file mode 100644 index 0000000000..c154a03eb4 --- /dev/null +++ b/cve_bin_tool/checkers/bluez.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +""" +CVE checker for Bluez +References: +https://www.cvedetails.com/vulnerability-list/vendor_id-8316/product_id-35116/Bluez-Bluez.html + +""" +from ..util import regex_find + +# def get_version(lines, filename): +def get_version(lines, filename): + """Bluetoothctl will work for Version 5.0+""" + regex = [r"bluetoothctl: ([5]+\.[0-9]+\.[0-9]+)"] + version_info = dict() + if filename[::-1].startswith(("bluetoothctl")[::-1]): + version_info["is_or_contains"] = "is" + + if "is_or_contains" in version_info: + version_info["modulename"] = "bluetoothctl" + version_info["version"] = regex_find(lines, *regex) + elif "libbluetooth.so" in filename: + version_info["is_or_contains"] = "is" + + return version_info From 0cde93bc6997e38b43bf6cd6121fa2f89a03d6d0 Mon Sep 17 00:00:00 2001 From: FReeshabh Date: Fri, 18 Oct 2019 20:06:27 -0500 Subject: [PATCH 2/3] Added Vpkg at the bottom of the Docstring modified: bluez.py --- cve_bin_tool/checkers/bluez.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cve_bin_tool/checkers/bluez.py b/cve_bin_tool/checkers/bluez.py index c154a03eb4..b185a8b3f5 100644 --- a/cve_bin_tool/checkers/bluez.py +++ b/cve_bin_tool/checkers/bluez.py @@ -9,7 +9,9 @@ # def get_version(lines, filename): def get_version(lines, filename): - """Bluetoothctl will work for Version 5.0+""" + """Bluetoothctl will work for Version 5.0+ + Vpkg: bluez, bluez + """ regex = [r"bluetoothctl: ([5]+\.[0-9]+\.[0-9]+)"] version_info = dict() if filename[::-1].startswith(("bluetoothctl")[::-1]): From 6d647a8dacdc4d0db620b3993c8150022912ba62 Mon Sep 17 00:00:00 2001 From: FReeshabh Date: Fri, 18 Oct 2019 20:07:19 -0500 Subject: [PATCH 3/3] Removed the unnessecary comment modified: bluez.py --- cve_bin_tool/checkers/bluez.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cve_bin_tool/checkers/bluez.py b/cve_bin_tool/checkers/bluez.py index b185a8b3f5..438b57d588 100644 --- a/cve_bin_tool/checkers/bluez.py +++ b/cve_bin_tool/checkers/bluez.py @@ -7,7 +7,6 @@ """ from ..util import regex_find -# def get_version(lines, filename): def get_version(lines, filename): """Bluetoothctl will work for Version 5.0+ Vpkg: bluez, bluez