Skip to content

Commit

Permalink
GnuPG checker (#1130)
Browse files Browse the repository at this point in the history
Fixes: #1128

Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
  • Loading branch information
alt-glitch committed Apr 28, 2021
1 parent 39ce741 commit 2d0e6e0
Show file tree
Hide file tree
Showing 5 changed files with 46 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 @@ -26,6 +26,7 @@
"freeradius",
"gcc",
"gimp",
"gnupg",
"gnutls",
"glibc",
"gstreamer",
Expand Down
23 changes: 23 additions & 0 deletions cve_bin_tool/checkers/gnupg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CVE checker for GNUPG
https://www.cvedetails.com/vulnerability-list/vendor_id-4711/product_id-8075/Gnupg-Gnupg.html
"""
from cve_bin_tool.checkers import Checker


class GnupgChecker(Checker):
CONTAINS_PATTERNS = []
FILENAME_PATTERNS = [
"gpg",
"g13",
]
VERSION_PATTERNS = [
r"GNU Privacy Guard's OpenPGP server ([0-9]+\.[0-9]+\.[0-9]+) ready",
r"GNU Privacy Guard's G13 server ([0-9]+\.[0-9]+\.[0-9]+) ready",
]
VENDOR_PRODUCT = [("gnupg", "gnupg")]
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 @@ -18,6 +18,7 @@
"gcc",
"gimp",
"glibc",
"gnupg",
"gnutls",
"gstreamer",
"haproxy",
Expand Down
21 changes: 21 additions & 0 deletions test/test_data/gnupg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mapping_test_data = [
{
"product": "gnupg",
"version": "2.2.27",
"version_strings": ["GNU Privacy Guard's OpenPGP server 2.2.27 ready"],
},
{
"product": "gnupg",
"version": "2.2.23",
"version_strings": ["GNU Privacy Guard's G13 server 2.2.23 ready"],
},
]

package_test_data = [
{
"url": "http://mirror.centos.org/centos/7/os/x86_64/Packages/",
"package_name": "gnupg2-2.0.22-5.el7_5.x86_64.rpm",
"product": "gnupg",
"version": "2.0.22",
},
]

0 comments on commit 2d0e6e0

Please sign in to comment.