From cb96f72c7286110e8f1e89e2923c064fa4c36b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maja=20G=C3=B3recka-Wolniewicz?= Date: Tue, 28 May 2024 12:09:16 +0200 Subject: [PATCH] sslscan added to sanity tests --- core/SanityTests.php | 33 +++++++++++++++++++++++++++++++++ web/admin/sanity_tests.php | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/core/SanityTests.php b/core/SanityTests.php index ce8e010fe..0a03919b2 100644 --- a/core/SanityTests.php +++ b/core/SanityTests.php @@ -587,6 +587,39 @@ private function testOpenssl() } } + /** + * test if sslscan is available + * + * @return void + */ + private function testSslscan() + { + $A = $this->getExecPath('sslscan'); + if ($A['exec'] != "" && $A['exec_is'] == "EXPLICIT" && !file_exists($A['exec'])) { + $this->storeTestResult(\core\common\Entity::L_ERROR, "sslscan is configured explicitly and was not found on your system!"); + } else { + exec($A['exec'] . ' --version --xml=-', $output, $res); + if ($res == 0) { + $xml = simplexml_load_string(implode($output)); + $resarray = json_decode(json_encode((array)$xml),true); + $t = 'sslscan'; + if (isset($resarray['@attributes']) and isset($resarray['@attributes']['version'])) { + $t = 'sslscan ' . $resarray['@attributes']['version']; + } + } else { + $t = ''; + } + if ($t != '') { + if ($A['exec_is'] == "EXPLICIT") { + $this->storeTestResult(\core\common\Entity::L_OK, "$t was found and is configured explicitly in your config."); + } else { + $this->storeTestResult(\core\common\Entity::L_WARN, "$t was found, but is not configured with an absolute path in your config."); + } + } else { + $this->storeTestResult(\core\common\Entity::L_ERROR, "sslscan was not found on your system!"); + } + } + } /** * test if makensis is available * diff --git a/web/admin/sanity_tests.php b/web/admin/sanity_tests.php index 89b7cc68f..0d757f4c1 100644 --- a/web/admin/sanity_tests.php +++ b/web/admin/sanity_tests.php @@ -30,7 +30,8 @@ 'Php', 'PhpModules', 'Openssl', - 'Zip', + 'Sslscan', + //'Zip', 'Logdir', 'Locales', 'Defaults',