Skip to content

Commit ec67e43

Browse files
authored
fix: improve cryptsetup checker (#4086)
Update cryptsetup pattern to detect version in libcryptsetup Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent f58f6ed commit ec67e43

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

cve_bin_tool/checkers/cryptsetup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ class CryptsetupChecker(Checker):
1717
r"Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.",
1818
]
1919
FILENAME_PATTERNS = [r"cryptsetup"]
20-
VERSION_PATTERNS = [r"cryptsetup ([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VERSION_PATTERNS = [
21+
r"cryptsetup ([0-9]+\.[0-9]+\.[0-9]+)",
22+
r"cryptsetup library version %s.\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
23+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nCrypto backend \(%s\) initialized in cryptsetup",
24+
]
2125
VENDOR_PRODUCT = [("cryptsetup_project", "cryptsetup")]
Binary file not shown.

test/test_data/cryptsetup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@
2929
"version": "2.3.6",
3030
},
3131
{
32-
"url": " http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
32+
"url": "http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
3333
"package_name": "cryptsetup-2.0.3-6.el7.aarch64.rpm",
3434
"product": "cryptsetup",
3535
"version": "2.0.3",
3636
},
37+
{
38+
"url": "http://ftp.fr.debian.org/debian/pool/main/c/cryptsetup/",
39+
"package_name": "libcryptsetup12_2.1.0-5+deb10u2_arm64.deb",
40+
"product": "cryptsetup",
41+
"version": "2.1.0",
42+
},
3743
]

0 commit comments

Comments
 (0)