Skip to content

Commit

Permalink
Add libsoup checker (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie committed Apr 22, 2021
1 parent 10cb6fd commit d681c9c
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 @@ -41,6 +41,7 @@
"libjpeg",
"libnss",
"libsndfile",
"libsoup",
"libtiff",
"libvirt",
"libxslt",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/libsoup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CVE checker for libsoup
https://www.cvedetails.com/product/21096/Gnome-Libsoup.html?vendor_id=283
"""
from cve_bin_tool.checkers import Checker


class LibsoupChecker(Checker):
CONTAINS_PATTERNS = []
FILENAME_PATTERNS = [r"libsoup"]
VERSION_PATTERNS = [r"libsoup/([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [
("gnome", "libsoup"),
("joe_shaw", "libsoup"),
("libsoup", "libsoup"),
]
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions test/test_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"libgcrypt",
"libjpeg-turbo",
"libsndfile",
"libsoup",
"libvirt",
"libxslt",
"mariadb",
Expand Down
29 changes: 29 additions & 0 deletions test/test_data/libsoup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "libsoup",
"version": "2.70.0",
"version_strings": ["libsoup/2.70.0"],
},
{
"product": "libsoup",
"version": "2.62.3",
"version_strings": ["libsoup/2.62.3"],
},
]
package_test_data = [
{
"url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/aarch64/os/Packages/l/",
"package_name": "libsoup-2.70.0-1.fc32.aarch64.rpm",
"product": "libsoup",
"version": "2.70.0",
},
{
"url": "http://mirror.centos.org/centos/8/BaseOS/aarch64/os/Packages/",
"package_name": "libsoup-2.62.3-2.el8.aarch64.rpm",
"product": "libsoup",
"version": "2.62.3",
},
]

0 comments on commit d681c9c

Please sign in to comment.