Skip to content

Commit

Permalink
Add Libssh2 checker (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie committed May 4, 2021
1 parent 8b2aaee commit 54f7860
Show file tree
Hide file tree
Showing 6 changed files with 48 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 @@ -43,6 +43,7 @@
"libnss",
"libsndfile",
"libsoup",
"libssh2",
"libtiff",
"libvirt",
"libxslt",
Expand Down
17 changes: 17 additions & 0 deletions cve_bin_tool/checkers/libssh2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CVE checker for libssh2
https://www.cvedetails.com/product/31293/Libssh2-Libssh2.html?vendor_id=15300
"""
from cve_bin_tool.checkers import Checker


class Libssh2Checker(Checker):
CONTAINS_PATTERNS = []
FILENAME_PATTERNS = [r"libssh2"]
VERSION_PATTERNS = [r"SSH-2.0-libssh2_([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("libssh2", "libssh2")]
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 @@ -35,6 +35,7 @@
"libjpeg-turbo",
"libsndfile",
"libsoup",
"libssh2",
"libvirt",
"libxslt",
"mariadb",
Expand Down
29 changes: 29 additions & 0 deletions test/test_data/libssh2.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": "libssh2",
"version": "1.8.0",
"version_strings": ["SSH-2.0-libssh2_1.8.0"],
},
{
"product": "libssh2",
"version": "1.9.0",
"version_strings": ["SSH-2.0-libssh2_1.9.0"],
},
]
package_test_data = [
{
"url": "https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/l/",
"package_name": "libssh2-1.9.0-5.el8.aarch64.rpm",
"product": "libssh2",
"version": "1.9.0",
},
{
"url": "http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
"package_name": "libssh2-1.8.0-4.el7.aarch64.rpm",
"product": "libssh2",
"version": "1.8.0",
},
]

0 comments on commit 54f7860

Please sign in to comment.