Skip to content

Commit 323809e

Browse files
authored
feat(checker): Add cryptsetup Checker (#1217)
1 parent b94cc01 commit 323809e

File tree

6 files changed

+60
-0
lines changed

6 files changed

+60
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"bubblewrap",
2121
"busybox",
2222
"bzip2",
23+
"cryptsetup",
2324
"cups",
2425
"curl",
2526
"dnsmasq",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (C) 2021 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for cryptsetup
7+
8+
https://www.cvedetails.com/product/35660/?q=Cryptsetup
9+
10+
"""
11+
from cve_bin_tool.checkers import Checker
12+
13+
14+
class CryptsetupChecker(Checker):
15+
CONTAIN_PATTERNS = [
16+
r"Legacy offline reencryption already in-progress. Use cryptsetup-reencrypt utility.",
17+
r"Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.",
18+
]
19+
FILENAME_PATTERNS = [r"cryptsetup"]
20+
VERSION_PATTERNS = [r"cryptsetup ([0-9]+\.[0-9]+\.[0-9]+)"]
21+
VENDOR_PRODUCT = [("cryptsetup_project", "cryptsetup")]
6.66 KB
Binary file not shown.
9.2 KB
Binary file not shown.

test/test_data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"bubblewrap",
1212
"busybox",
1313
"bzip2",
14+
"cryptsetup",
1415
"cups",
1516
"curl",
1617
"dnsmasq",

test/test_data/cryptsetup.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2021 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "cryptsetup",
7+
"version": "2.3.6",
8+
"version_strings": [
9+
"Legacy offline reencryption already in-progress. Use cryptsetup-reencrypt utility.",
10+
"Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.",
11+
"cryptsetup 2.3.6",
12+
],
13+
},
14+
{
15+
"product": "cryptsetup",
16+
"version": "2.0.3",
17+
"version_strings": [
18+
"Legacy offline reencryption already in-progress. Use cryptsetup-reencrypt utility.",
19+
"Only LUKS2 format is currently supported. Please use cryptsetup-reencrypt tool for LUKS1.",
20+
"cryptsetup 2.0.3",
21+
],
22+
},
23+
]
24+
package_test_data = [
25+
{
26+
"url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/c/",
27+
"package_name": "cryptsetup-2.3.6-1.fc35.aarch64.rpm",
28+
"product": "cryptsetup",
29+
"version": "2.3.6",
30+
},
31+
{
32+
"url": " http://mirror.centos.org/altarch/7/os/aarch64/Packages/",
33+
"package_name": "cryptsetup-2.0.3-6.el7.aarch64.rpm",
34+
"product": "cryptsetup",
35+
"version": "2.0.3",
36+
},
37+
]

0 commit comments

Comments
 (0)