Skip to content

Commit

Permalink
feat(checker): add pjsip checker
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Feb 28, 2025
1 parent 62b6c14 commit 29c05bc
Show file tree
Hide file tree
Showing 7 changed files with 52 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 @@ -310,6 +310,7 @@
"picocom",
"pigz",
"pixman",
"pjsip",
"png",
"polarssl_fedora",
"poppler",
Expand Down
21 changes: 21 additions & 0 deletions cve_bin_tool/checkers/pjsip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for pjsip
https://www.cvedetails.com/product/44396/Teluu-Pjsip.html?vendor_id=17771
https://www.cvedetails.com/product/65638/Pjsip-Pjsip.html?vendor_id=21360
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class PjsipChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"PJ_[A-Za-z0-9_:%) ]*\r?\n([0-9]+\.[0-9]+(\.[0-9]+)?)"]
VENDOR_PRODUCT = [("pjsip", "pjsip"), ("teluu", "pjsip")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions test/test_data/asterisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@
"package_name": "asterisk-18.12.1-1.fc37.1.aarch64.rpm",
"product": "asterisk",
"version": "18.12.1",
"other_products": ["pjsip"],
},
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/a/",
"package_name": "asterisk-18.12.1-1.fc37.1.i686.rpm",
"product": "asterisk",
"version": "18.12.1",
"other_products": ["pjsip"],
},
{
"url": "http://ftp.debian.org/debian/pool/main/a/asterisk/",
"package_name": "asterisk_16.16.1~dfsg-1+deb11u1_arm64.deb",
"product": "asterisk",
"version": "16.16.1",
"other_products": ["pjsip"],
},
{
"url": "https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_generic/telephony/",
Expand Down
27 changes: 27 additions & 0 deletions test/test_data/pjsip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "pjsip", "version": "2.9", "version_strings": ["PJ_\n2.9"]}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/p/",
"package_name": "pjproject-2.13.1-6.fc42.aarch64.rpm",
"product": "pjsip",
"version": "2.13.1",
"other_products": ["libsrtp"],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/telephony/",
"package_name": "libpj_2.10-3_x86_64.ipk",
"product": "pjsip",
"version": "2.10",
},
{
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
"package_name": "pjproject-2.9-r0.apk",
"product": "pjsip",
"version": "2.9",
},
]

0 comments on commit 29c05bc

Please sign in to comment.