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 gpgme Checker #1222

Merged
merged 1 commit into from
Jul 6, 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 @@ -34,6 +34,7 @@
"gnupg",
"gnutls",
"glibc",
"gpgme",
"gstreamer",
"haproxy",
"hostapd",
Expand Down
21 changes: 21 additions & 0 deletions cve_bin_tool/checkers/gpgme.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 gpgme

https://www.cvedetails.com/product/94121/?q=Gpgme
https://www.cvedetails.com/product/10513/GNU-Gpgme.html?vendor_id=72

"""
from cve_bin_tool.checkers import Checker


class GpgmeChecker(Checker):
CONTAINS_PATTERNS = []
FILENAME_PATTERNS = [r"gpgme"]
VERSION_PATTERNS = [
r"This is GPGME ([0-9]+\.[0-9]+\.[0-9]+) \- The GnuPG Made Easy library",
r"GPGME-Tool ([0-9]+\.[0-9]+\.[0-9]+) ready",
]
VENDOR_PRODUCT = [("gnupg", "gpgme"), ("gnu", "gpgme")]
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 @@ -25,6 +25,7 @@
"glibc",
"gnupg",
"gnutls",
"gpgme",
"gstreamer",
"haproxy",
"hostapd",
Expand Down
35 changes: 35 additions & 0 deletions test/test_data/gpgme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "gpgme",
"version": "1.16.0",
"version_strings": [
"GPGME-Tool 1.16.0 ready",
"This is GPGME 1.16.0 - The GnuPG Made Easy library",
],
},
{
"product": "gpgme",
"version": "1.13.1",
"version_strings": [
"GPGME-Tool 1.13.1 ready",
"This is GPGME 1.13.1 - The GnuPG Made Easy library",
],
},
]
package_test_data = [
{
"url": "https://eu.mirror.archlinuxarm.org/aarch64/core/",
"package_name": "gpgme-1.16.0-1-aarch64.pkg.tar.xz",
"product": "gpgme",
"version": "1.16.0",
},
{
"url": "https://ftp.lysator.liu.se/pub/opensuse/ports/aarch64/distribution/leap/15.2/repo/oss/aarch64/",
"package_name": "gpgme-1.13.1-lp152.2.1.aarch64.rpm",
"product": "gpgme",
"version": "1.13.1",
},
]