Skip to content

Commit

Permalink
feat(checker): add libraw checker (#2635)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine authored Feb 2, 2023
1 parent 19cfc12 commit 0a06dac
Show file tree
Hide file tree
Showing 7 changed files with 73 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 @@ -130,6 +130,7 @@
"libmatroska",
"libnss",
"libpcap",
"libraw",
"librsvg",
"librsync",
"libsamplerate",
Expand Down
23 changes: 23 additions & 0 deletions cve_bin_tool/checkers/libraw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for libraw
https://www.cvedetails.com/product/25761/Libraw-Libraw.html?vendor_id=12800
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class LibrawChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"([0-9]+\.[0-9]+\.[0-9]+)-Release[a-zA-z \r\n]*Reading RAW",
r"[lL]ibraw[a-zA-z ,/\r\n]*([0-9]+\.[0-9]+\.[0-9]+)-Release",
]
VENDOR_PRODUCT = [("libraw", "libraw")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49 changes: 49 additions & 0 deletions test/test_data/libraw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "libraw",
"version": "0.20.2",
"version_strings": [
"0.20.2-Release\nOpening file\nStarting\nReading metadata\nAdjusting size\nReading RAW data"
],
},
{
"product": "libraw",
"version": "0.16.0",
"version_strings": [
"Out of order call of libraw function\nNo thumbnail in file\n0.16.0-Release"
],
},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
"package_name": "LibRaw-0.20.2-7.fc37.aarch64.rpm",
"product": "libraw",
"version": "0.20.2",
"other_products": [],
},
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/",
"package_name": "LibRaw-0.20.2-7.fc37.i686.rpm",
"product": "libraw",
"version": "0.20.2",
"other_products": [],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libr/libraw/",
"package_name": "libraw10_0.16.0-9+deb8u3_armel.deb",
"product": "libraw",
"version": "0.16.0",
"other_products": [],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libr/libraw/",
"package_name": "libraw20_0.20.2-2+b1_arm64.deb",
"product": "libraw",
"version": "0.20.2",
"other_products": [],
},
]

0 comments on commit 0a06dac

Please sign in to comment.