Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checker): Add enscript Checker #1216

Merged
merged 1 commit into from
Jul 7, 2021
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
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dnsmasq",
"dovecot",
"dpkg",
"enscript",
"expat",
"ffmpeg",
"freeradius",
Expand Down
21 changes: 21 additions & 0 deletions cve_bin_tool/checkers/enscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for enscript

https://www.cvedetails.com/product/1800/?q=Enscript

"""
from cve_bin_tool.checkers import Checker


class EnscriptChecker(Checker):
CONTAINS_PATTERNS = [
r"set the PostScript language level that enscript",
r"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
]
FILENAME_PATTERNS = [r"enscript"]
VERSION_PATTERNS = [r"GNU Enscript ([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("gnu", "enscript")]
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 @@ -16,6 +16,7 @@
"dnsmasq",
"dovecot",
"dpkg",
"enscript",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice you have to add the checker in two init.py files. Is there any way we could make it so we only have one canonical list of checkers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed issue #1223 to look into this later, since it's not something that needs to be fixed in this checker specifically.

"expat",
"ffmpeg",
"freeradius",
Expand Down
37 changes: 37 additions & 0 deletions test/test_data/enscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "enscript",
"version": "1.6.6",
"version_strings": [
"set the PostScript language level that enscript",
"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
"GNU Enscript 1.6.6",
],
},
{
"product": "enscript",
"version": "1.6.5",
"version_strings": [
"set the PostScript language level that enscript",
"or set the environment variable `ENSCRIPT_LIBRARY' to point to your library directory.",
"GNU Enscript 1.6.5",
],
},
]
package_test_data = [
{
"url": "http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
"package_name": "enscript-1.6.6-7.el7.aarch64.rpm",
"product": "enscript",
"version": "1.6.6",
},
{
"url": "http://archive.ubuntu.com/ubuntu/pool/universe/e/enscript/",
"package_name": "enscript_1.6.5.90-3_amd64.deb",
"product": "enscript",
"version": "1.6.5",
},
]