Skip to content

Commit

Permalink
sslscan added to sanity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Górecka-Wolniewicz committed May 28, 2024
1 parent c1ce40b commit cb96f72
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions core/SanityTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<strong>sslscan</strong> 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, "<strong>$t</strong> was found and is configured explicitly in your config.");
} else {
$this->storeTestResult(\core\common\Entity::L_WARN, "<strong>$t</strong> was found, but is not configured with an absolute path in your config.");
}
} else {
$this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>sslscan</strong> was not found on your system!");
}
}
}
/**
* test if makensis is available
*
Expand Down
3 changes: 2 additions & 1 deletion web/admin/sanity_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
'Php',
'PhpModules',
'Openssl',
'Zip',
'Sslscan',
//'Zip',
'Logdir',
'Locales',
'Defaults',
Expand Down

0 comments on commit cb96f72

Please sign in to comment.