Skip to content

Commit

Permalink
feat(checker): add libidn2 checker (#2628)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine authored Feb 1, 2023
1 parent 80d08ff commit ffda376
Show file tree
Hide file tree
Showing 8 changed files with 82 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 @@ -120,6 +120,7 @@
"libgcrypt",
"libgit2",
"libical",
"libidn2",
"libinput",
"libjpeg",
"libjpeg_turbo",
Expand Down
24 changes: 24 additions & 0 deletions cve_bin_tool/checkers/libidn2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for libidn2
https://www.cvedetails.com/product/65468/GNU-Libidn2.html?vendor_id=72
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class Libidn2Checker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"libidn2[a-z0-9\.]*-([0-9]+\.[0-9]+\.[0-9]+)",
r"Simon Josefsson[a-zA-Z ,]*\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nCopyright \(C\) [0-9-]* Simon Josefsson",
]
VENDOR_PRODUCT = [("gnu", "libidn2")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
57 changes: 57 additions & 0 deletions test/test_data/libidn2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "libidn2",
"version": "2.3.3",
"version_strings": ["libidn2.so.0.3.8-2.3.3"],
},
{
"product": "libidn2",
"version": "2.3.0",
"version_strings": ["Simon Josefsson, Tim Ruehsen\n2.3.0"],
},
{
"product": "libidn2",
"version": "2.0.5",
"version_strings": ["2.0.5\nCopyright (C) 2011-2016 Simon Josefsson"],
},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
"package_name": "libidn2-2.3.3-2.fc37.aarch64.rpm",
"product": "libidn2",
"version": "2.3.3",
"other_products": [],
},
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/",
"package_name": "libidn2-2.3.3-2.fc37.i686.rpm",
"product": "libidn2",
"version": "2.3.3",
"other_products": [],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libi/libidn2/",
"package_name": "libidn2-0_2.0.5-1+deb10u1_amd64.deb",
"product": "libidn2",
"version": "2.0.5",
"other_products": [],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libi/libidn2/",
"package_name": "libidn2-0_2.3.0-5_mips64el.deb",
"product": "libidn2",
"version": "2.3.0",
"other_products": [],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "libidn2_2.0.5-1_x86_64.ipk",
"product": "libidn2",
"version": "2.0.5",
"other_products": [],
},
]

0 comments on commit ffda376

Please sign in to comment.