Skip to content

Commit

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


"""
CVE checker for micropython
https://www.cvedetails.com/product/167231/Micropython-Micropython.html?vendor_id=34177
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class MicropythonChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"MicroPython v([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("micropython", "micropython")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions test/test_data/micropython.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (C) 2024 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "micropython",
"version": "1.19.1",
"version_strings": ["MicroPython v1.19.1"],
}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/m/",
"package_name": "micropython-1.21.0-1.fc40.x86_64.rpm",
"product": "micropython",
"version": "1.21.0",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/m/micropython/",
"package_name": "micropython_1.19.1+ds-1_amd64.deb",
"product": "micropython",
"version": "1.19.1",
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "micropython_1.9.4-1_x86_64.ipk",
"product": "micropython",
"version": "1.9.4",
},
]

0 comments on commit 0705194

Please sign in to comment.