Skip to content

Commit

Permalink
fix: improve cryptsetup checker
Browse files Browse the repository at this point in the history
Update cryptsetup pattern to detect version in libcryptsetup

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Apr 25, 2024
1 parent f58f6ed commit ee2b409
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cve_bin_tool/checkers/cryptsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ class CryptsetupChecker(Checker):
r"Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.",
]
FILENAME_PATTERNS = [r"cryptsetup"]
VERSION_PATTERNS = [r"cryptsetup ([0-9]+\.[0-9]+\.[0-9]+)"]
VERSION_PATTERNS = [
r"cryptsetup ([0-9]+\.[0-9]+\.[0-9]+)",
r"cryptsetup library version %s.\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nCrypto backend \(%s\) initialized in cryptsetup",
]
VENDOR_PRODUCT = [("cryptsetup_project", "cryptsetup")]
Binary file not shown.
8 changes: 7 additions & 1 deletion test/test_data/cryptsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@
"version": "2.3.6",
},
{
"url": " http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
"url": "http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
"package_name": "cryptsetup-2.0.3-6.el7.aarch64.rpm",
"product": "cryptsetup",
"version": "2.0.3",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/c/cryptsetup/",
"package_name": "libcryptsetup12_2.1.0-5+deb10u2_arm64.deb",
"product": "cryptsetup",
"version": "2.1.0",
},
]

0 comments on commit ee2b409

Please sign in to comment.