Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
""" CVE Checkers """
__all__ = [
"bluez",
"curl",
"node",
"xml2",
"expat",
"openssl",
"tiff",
"zlib",
"icu",
"kerberos",
"libgcrypt",
"libjpeg",
"libnss",
"node",
"openssh",
"openssl",
"png",
"xerces",
"libjpeg",
"xerces",
"libgcrypt",
"systemd",
"sqlite",
"kerberos",
"icu",
"openssh",
"bluez",
"systemd",
"tiff",
"xerces",
"xml2",
"zlib",
]
23 changes: 17 additions & 6 deletions cve_bin_tool/checkers/openssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

import sys, re


def get_version(lines, filename):
"""
Get the version and return it for OpenSSH server or client

VPkg: openssh
VPkg: openbsd, openssh
"""
regex = re.compile("OpenSSH_([0-9]+\.[0-9]+[0-9a-z\s]*)")
version_info = dict()
Expand All @@ -23,11 +24,21 @@ def get_version(lines, filename):
for l in lines:
if regex.match(l):
version_info["version"] = regex.match(l).groups()[0]
break # The binary seems to contain many version strings and the
#first one matches the binary in question

if filename in ["scp", "sftp", "ssh", "ssh-add", "ssh-agent", "ssh-argv0", \
"ssh-copy-id", "ssh-keygen", "ssh-keyscan", "slogin"]:
break # The binary seems to contain many version strings and the
# first one matches the binary in question

if filename in [
"scp",
"sftp",
"ssh",
"ssh-add",
"ssh-agent",
"ssh-argv0",
"ssh-copy-id",
"ssh-keygen",
"ssh-keyscan",
"slogin",
]:
version_info["is_or_contains"] = "is"
version_info["modulename"] = "openssh-client"
elif filename in ["sshd"]:
Expand Down