Skip to content

Commit 5fee6ef

Browse files
authored
fix: update polarssl checker (#5340)
Update polarssl pattern to detect version in alpine Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent db81bfc commit 5fee6ef

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
"pixman",
341341
"pjsip",
342342
"png",
343-
"polarssl_fedora",
343+
"polarssl",
344344
"poppler",
345345
"postgresql",
346346
"ppp",

cve_bin_tool/checkers/polarssl_fedora.py renamed to cve_bin_tool/checkers/polarssl.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
"""
66
CVE checker for polarssl
77
8-
This checker currently works on only fedora distribution, because of lack of common signatures
9-
in other distributions, with unsuccessful attempts made for CentOS and ubuntu distributions.
10-
118
https://www.cvedetails.com/product/22470/Polarssl-Polarssl.html?vendor_id=12001
129
1310
"""
1411
from cve_bin_tool.checkers import Checker
1512

1613

17-
class PolarsslFedoraChecker(Checker):
14+
class PolarsslChecker(Checker):
1815
CONTAINS_PATTERNS = [
1916
r"Bad usage of mbedtls_ssl_set_bio() or mbedtls_ssl_set_bio()",
2017
r"You must use mbedtls_ssl_set_timer_cb() for DTLS",
@@ -25,9 +22,7 @@ class PolarsslFedoraChecker(Checker):
2522
# r"mbedtls_x509_crt_check_extended_key_usage",
2623
]
2724
FILENAME_PATTERNS = [r"libpolarssl.so."]
28-
VERSION_PATTERNS = [
29-
r"libpolarssl.so.([0-9]+\.[0-9]+\.[0-9]+)"
30-
] # patterns like this aren't ideal
25+
VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nPOLARSSL"]
3126
VENDOR_PRODUCT = [("polarssl", "polarssl")]
3227

3328

81.9 KB
Binary file not shown.

test/test_data/polarssl_fedora.py renamed to test/test_data/polarssl.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"product": "polarssl",
77
"version": "1.3.6",
8-
"version_strings": ["libpolarssl.so.1.3.6.debug"],
8+
"version_strings": ["1.3.6\nPOLARSSL"],
99
}
1010
]
1111
package_test_data = [
@@ -14,5 +14,12 @@
1414
"package_name": "polarssl-1.3.7-2.fc21.x86_64.rpm",
1515
"product": "polarssl",
1616
"version": "1.3.7",
17-
}
17+
},
18+
{
19+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.1/main/x86_64/",
20+
"package_name": "polarssl-1.3.8-r1.apk",
21+
"product": "polarssl",
22+
"version": "1.3.8",
23+
"other_products": ["gcc"],
24+
},
1825
]

0 commit comments

Comments
 (0)