Skip to content

Commit 59934f1

Browse files
authored
feat(checker): add libreswan checker (#4814)
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
1 parent c4cf104 commit 59934f1

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
"libpcap",
201201
"libraw",
202202
"libreoffice",
203+
"libreswan",
203204
"librsvg",
204205
"librsync",
205206
"libsamplerate",

cve_bin_tool/checkers/libreswan.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for libreswan
7+
8+
https://www.cvedetails.com/product/26318/Libreswan-Libreswan.html?vendor_id=12913
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class LibreswanChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"libreswan-([0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("libreswan", "libreswan")]
272 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
447 KB
Binary file not shown.

test/test_data/libreswan.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "libreswan", "version": "3.32", "version_strings": ["libreswan-3.32"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
10+
"package_name": "libreswan-5.1-5.fc42.aarch64.rpm",
11+
"product": "libreswan",
12+
"version": "5.1",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/libr/libreswan/",
16+
"package_name": "libreswan_3.27-6+deb10u1_amd64.deb",
17+
"product": "libreswan",
18+
"version": "3.27",
19+
},
20+
{
21+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
22+
"package_name": "libreswan_3.32-1_x86_64.ipk",
23+
"product": "libreswan",
24+
"version": "3.32",
25+
},
26+
{
27+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/",
28+
"package_name": "libreswan-3.29-r1.apk",
29+
"product": "libreswan",
30+
"version": "3.29",
31+
},
32+
]

0 commit comments

Comments
 (0)