@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public static function deleteObsoleteTempDirs() { |
| 36 | 36 | $downloadsDirs = [ |
| 37 | - 'site_installers' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/installer_cache", |
|
| 38 | - 'silverbullet' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/silverbullet" |
|
| 37 | + 'site_installers' => dirname(dirname(dirname(dirname(__FILE__))))."/var/installer_cache", |
|
| 38 | + 'silverbullet' => dirname(dirname(dirname(dirname(__FILE__))))."/var/silverbullet" |
|
| 39 | 39 | ]; |
| 40 | 40 | $tm = time(); |
| 41 | 41 | $i = 0; |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | if ($entry === '.' || $entry === '..' || $entry === '.gitignore') { |
| 55 | 55 | continue; |
| 56 | 56 | } |
| 57 | - $ftime = $tm - filemtime($downloads . '/' . $entry); |
|
| 57 | + $ftime = $tm - filemtime($downloads.'/'.$entry); |
|
| 58 | 58 | if ($ftime < 3600) { |
| 59 | 59 | continue; |
| 60 | 60 | } |
| 61 | 61 | if (isset($Cache[$entry])) { |
| 62 | 62 | continue; |
| 63 | 63 | } |
| 64 | - \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
| 64 | + \core\common\Entity::rrmdir($downloads.'/'.$entry); |
|
| 65 | 65 | $i = $i + 1; |
| 66 | 66 | print "$entry\n"; |
| 67 | 67 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @author Stefan Winter <[email protected]> |
| 26 | 26 | * @package Core |
| 27 | 27 | */ |
| 28 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
| 28 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
| 29 | 29 | |
| 30 | 30 | $Gui = new \web\lib\user\Gui(); |
| 31 | 31 | // ... unless overwritten by direct GET/POST parameter in the request or a SESSION setting |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @author Stefan Winter <[email protected]> |
| 26 | 26 | * @package Core |
| 27 | 27 | */ |
| 28 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
| 28 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
| 29 | 29 | |
| 30 | 30 | $Gui = new \web\lib\user\Gui(); |
| 31 | 31 | // ... unless overwritten by direct GET/POST parameter in the request or a SESSION setting |
@@ -138,8 +138,8 @@ |
||
| 138 | 138 | */ |
| 139 | 139 | private function zipInstaller() { |
| 140 | 140 | // one can always access $this->attributes to check things |
| 141 | - $fileName = $this->installerBasename . '.zip'; |
|
| 142 | - $output = system('zip -q ' . $fileName . ' *'); |
|
| 141 | + $fileName = $this->installerBasename.'.zip'; |
|
| 142 | + $output = system('zip -q '.$fileName.' *'); |
|
| 143 | 143 | if ($output === FALSE) { |
| 144 | 144 | $this->loggerInstance->debug(2, "unable to zip the installer\n"); |
| 145 | 145 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | final public function __construct() { |
| 31 | 31 | parent::__construct(); |
| 32 | 32 | $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]); |
| 33 | - $this->loggerInstance->debug(4,"RedirectEx called"); |
|
| 33 | + $this->loggerInstance->debug(4, "RedirectEx called"); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | $reqAuthenticator = random_bytes(16); |
| 89 | 89 | $packetIdentifier = random_bytes(1); |
| 90 | 90 | // construct Status-Server packet |
| 91 | - $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER . |
|
| 92 | - $packetIdentifier . |
|
| 93 | - RFC5997Tests::PACKET_LENGTH . |
|
| 94 | - $reqAuthenticator . |
|
| 95 | - RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER . |
|
| 96 | - RFC5997Tests::LENGTH_NAS_IDENTIFIER . |
|
| 91 | + $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER. |
|
| 92 | + $packetIdentifier. |
|
| 93 | + RFC5997Tests::PACKET_LENGTH. |
|
| 94 | + $reqAuthenticator. |
|
| 95 | + RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER. |
|
| 96 | + RFC5997Tests::LENGTH_NAS_IDENTIFIER. |
|
| 97 | 97 | RFC5997Tests::VALUE_NAS_IDENTIFIER; |
| 98 | - $sigPacket = $prePacket . |
|
| 99 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
| 100 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
| 98 | + $sigPacket = $prePacket. |
|
| 99 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
| 100 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
| 101 | 101 | "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0"; |
| 102 | - $authPacket = $prePacket . |
|
| 103 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
| 104 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
| 102 | + $authPacket = $prePacket. |
|
| 103 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
| 104 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
| 105 | 105 | hash_hmac("md5", $sigPacket, $this->secret, TRUE); |
| 106 | 106 | $connectErrorNumber = 0; |
| 107 | 107 | $connectErrorString = ""; |
| 108 | - $netHandle = fsockopen("udp://" . $this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
| 108 | + $netHandle = fsockopen("udp://".$this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
| 109 | 109 | if ($netHandle === FALSE) { |
| 110 | 110 | throw new Exception("Unable to establish UDP socket resource. Error number was $connectErrorNumber, '$connectErrorString'"); |
| 111 | 111 | } |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | return AbstractTest::RETVAL_INVALID; |
| 124 | 124 | } |
| 125 | 125 | // check the response authenticator to prevent spoofing. |
| 126 | - $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT . |
|
| 127 | - $packetIdentifier . |
|
| 128 | - $read[2] . $read[3] . |
|
| 129 | - $reqAuthenticator . |
|
| 130 | - substr($read, 20) . |
|
| 126 | + $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT. |
|
| 127 | + $packetIdentifier. |
|
| 128 | + $read[2].$read[3]. |
|
| 129 | + $reqAuthenticator. |
|
| 130 | + substr($read, 20). |
|
| 131 | 131 | $this->secret; |
| 132 | 132 | $expected = hash("md5", $sigResponse, TRUE); |
| 133 | 133 | if ($expected != substr($read, 4, 16)) { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * <base_url>/copyright.php after deploying the software |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
| 22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
| 23 | 23 | \core\CAT::sessionStart(); |
| 24 | 24 | $loggerInstance = new \core\common\Logging(); |
| 25 | 25 | $loggerInstance->debug(4, "Sociopath test\n"); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | return NULL; |
| 34 | 34 | } |
| 35 | 35 | $loggerInstance->debug(4, $_SESSION['EVIDENCE']['QUESTIONSASKED']); |
| 36 | - $loggerInstance->debug(4, "\nAnswer question " . $QNUM . "\n"); |
|
| 36 | + $loggerInstance->debug(4, "\nAnswer question ".$QNUM."\n"); |
|
| 37 | 37 | switch ($answer) { |
| 38 | 38 | case 1: |
| 39 | 39 | $loggerInstance->debug(4, "Revaluate with FALSE"); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * <base_url>/copyright.php after deploying the software |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 23 | 23 | |
| 24 | 24 | \core\CAT::sessionStart(); |
| 25 | 25 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | exec("openssl ocsp -reqin $derFilePath -req_text", $output, $retval); |
| 98 | 98 | |
| 99 | 99 | if ($retval !== 0) { |
| 100 | - throw new Exception("openssl ocsp returned a non-zero return code. The DER data is probably bogus. B64 representation of DER data is: " . base64_encode($ocspRequestDer)); |
|
| 100 | + throw new Exception("openssl ocsp returned a non-zero return code. The DER data is probably bogus. B64 representation of DER data is: ".base64_encode($ocspRequestDer)); |
|
| 101 | 101 | } |
| 102 | 102 | if ($output === NULL) { // this can't really happen, but makes Scrutinizer happier |
| 103 | 103 | $output = []; |
@@ -127,14 +127,14 @@ discard block |
||
| 127 | 127 | * back (if we have it). |
| 128 | 128 | */ |
| 129 | 129 | if (strcasecmp($nameHash, OUR_NAME_HASH) != 0 || strcasecmp($keyHash, OUR_KEY_HASH) != 0) { |
| 130 | - throw new Exception("The request is about a different Issuer name / public key. Expected vs. actual name hash: " . OUR_NAME_HASH . " / $nameHash, " . OUR_KEY_HASH . " / $keyHash"); |
|
| 130 | + throw new Exception("The request is about a different Issuer name / public key. Expected vs. actual name hash: ".OUR_NAME_HASH." / $nameHash, ".OUR_KEY_HASH." / $keyHash"); |
|
| 131 | 131 | } |
| 132 | -error_log("base64-encoded request: " . base64_encode($ocspRequestDer)); |
|
| 132 | +error_log("base64-encoded request: ".base64_encode($ocspRequestDer)); |
|
| 133 | 133 | |
| 134 | -$response = fopen(__DIR__ . "/statements/" . $serialHex . ".der", "r"); |
|
| 134 | +$response = fopen(__DIR__."/statements/".$serialHex.".der", "r"); |
|
| 135 | 135 | if ($response === FALSE) { // not found |
| 136 | 136 | // first lets load the unauthorised response, which is the default reply |
| 137 | - $unauthResponse = fopen(__DIR__ . "/statements/UNAUTHORIZED.der", "r"); |
|
| 137 | + $unauthResponse = fopen(__DIR__."/statements/UNAUTHORIZED.der", "r"); |
|
| 138 | 138 | if ($unauthResponse === FALSE) { |
| 139 | 139 | throw new Exception("Unable to open our canned UNAUTHORIZED response!"); |
| 140 | 140 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $responseContent = fread($response, 1000000); |
| 178 | 178 | fclose($response); |
| 179 | -error_log("base64-encoded response: " . base64_encode($responseContent)); |
|
| 179 | +error_log("base64-encoded response: ".base64_encode($responseContent)); |
|
| 180 | 180 | header('Content-Type: application/ocsp-response'); |
| 181 | -header('Content-Length: ' . strlen($responseContent)); |
|
| 181 | +header('Content-Length: '.strlen($responseContent)); |
|
| 182 | 182 | echo $responseContent; |