@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function __construct() |
111 | 111 | { |
112 | 112 | $this->loggerInstance = new Logging(); |
113 | - $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n"); |
|
113 | + $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n"); |
|
114 | 114 | $this->languageInstance = new Language(); |
115 | 115 | Entity::intoThePotatoes("core"); |
116 | 116 | // some config elements are displayable. We need some dummies to |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | $dummy_organisation2a = _("organization"); |
130 | 130 | $dummy_organisation3 = _("entity"); |
131 | 131 | // and do something useless with the strings so that there's no "unused" complaint |
132 | - if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3 . $dummy_hotspot1 . $dummy_hotspot2 . $dummy_hotspot3 . $dummy_organisation1 . $dummy_organisation2 . $dummy_organisation2a . $dummy_organisation3) < 0) { |
|
132 | + if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3.$dummy_hotspot1.$dummy_hotspot2.$dummy_hotspot3.$dummy_organisation1.$dummy_organisation2.$dummy_organisation2a.$dummy_organisation3) < 0) { |
|
133 | 133 | throw new Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole."); |
134 | 134 | } |
135 | - $xyzVariableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . ""; |
|
136 | - $xyzVariableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . ""; |
|
137 | - $xyzVariableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot'] . ""; |
|
138 | - $xyzVariableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant'] . ""; |
|
135 | + $xyzVariableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation'].""; |
|
136 | + $xyzVariableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution'].""; |
|
137 | + $xyzVariableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot'].""; |
|
138 | + $xyzVariableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant'].""; |
|
139 | 139 | Entity::$nomenclature_fed = _($xyzVariableFed); |
140 | 140 | Entity::$nomenclature_inst = _($xyzVariableInst); |
141 | 141 | Entity::$nomenclature_hotspot = _($xyzVariableHotspot); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function __destruct() |
153 | 153 | { |
154 | - (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n"); |
|
154 | + (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n"); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | public static function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) |
185 | 185 | { |
186 | 186 | $loggerInstance = new Logging(); |
187 | - $name = md5(time() . rand()); |
|
187 | + $name = md5(time().rand()); |
|
188 | 188 | $path = ROOT; |
189 | 189 | switch ($purpose) { |
190 | 190 | case 'silverbullet': |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | default: |
203 | 203 | throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n"); |
204 | 204 | } |
205 | - $tmpDir = $path . '/' . $name; |
|
205 | + $tmpDir = $path.'/'.$name; |
|
206 | 206 | $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n"); |
207 | 207 | if (!mkdir($tmpDir, 0700, true)) { |
208 | 208 | if ($failIsFatal) { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public static function rrmdir($dir) |
225 | 225 | { |
226 | - foreach (glob($dir . '/*') as $file) { |
|
226 | + foreach (glob($dir.'/*') as $file) { |
|
227 | 227 | if (is_dir($file)) { |
228 | 228 | Entity::rrmdir($file); |
229 | 229 | } else { |
@@ -249,12 +249,12 @@ discard block |
||
249 | 249 | } |
250 | 250 | // these substr() are guaranteed to yield actual string data, as the |
251 | 251 | // base string is an MD5 hash - has sufficient length |
252 | - $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-'; |
|
253 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-'; |
|
254 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-'; |
|
255 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-'; |
|
252 | + $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-'; |
|
253 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-'; |
|
254 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-'; |
|
255 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-'; |
|
256 | 256 | $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12); |
257 | - return $prefix . $uuid; |
|
257 | + return $prefix.$uuid; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | for ($i = count($trace); $i--; $i > 0) { |
296 | 296 | if (isset($trace[$i - 1]['class']) && preg_match('/Entity/', $trace[$i - 1]['class'])) { |
297 | 297 | if ($showTrace) { |
298 | - echo "FOUND caller: " . print_r($trace[$i], true) . " - class is " . $trace[$i]['class']; |
|
298 | + echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class']; |
|
299 | 299 | } |
300 | 300 | $caller = $trace[$i]; |
301 | 301 | break; |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | // otherwise, on the filename relative to ROOT |
306 | 306 | $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT)); |
307 | 307 | if ($showTrace === TRUE) { |
308 | - echo "<pre>" . print_r($trace, true) . "</pre>"; |
|
309 | - echo "CLASS = " . $myName . "<br/>"; |
|
308 | + echo "<pre>".print_r($trace, true)."</pre>"; |
|
309 | + echo "CLASS = ".$myName."<br/>"; |
|
310 | 310 | } |
311 | 311 | if (preg_match("/diag/", $myName) == 1) { |
312 | 312 | $ret = "diagnostics"; |
@@ -340,10 +340,10 @@ discard block |
||
340 | 340 | if ($catalogue === NULL) { |
341 | 341 | $theCatalogue = Entity::determineOwnCatalogue($trace); |
342 | 342 | textdomain($theCatalogue); |
343 | - bindtextdomain($theCatalogue, ROOT . "/translation/"); |
|
343 | + bindtextdomain($theCatalogue, ROOT."/translation/"); |
|
344 | 344 | } else { |
345 | 345 | textdomain($catalogue); |
346 | - bindtextdomain($catalogue, ROOT . "/translation/"); |
|
346 | + bindtextdomain($catalogue, ROOT."/translation/"); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function writeToFile($filename, $message) |
51 | 51 | { |
52 | - file_put_contents(\config\Master::PATHS['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND); |
|
52 | + file_put_contents(\config\Master::PATHS['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } else { |
82 | 82 | $output .= var_export($stuff, TRUE); |
83 | 83 | } |
84 | - $output = $prefix . $output . $suffix; |
|
84 | + $output = $prefix.$output.$suffix; |
|
85 | 85 | $this->writeToFile("debug.log", $output); |
86 | 86 | |
87 | 87 | return; |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | $logTextStep1 = preg_replace("/[\n\r]/", "", $query); |
130 | 130 | $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1); |
131 | 131 | $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2); |
132 | - $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n"); |
|
132 | + $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n"); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | \ No newline at end of file |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $returnArray = []; |
70 | 70 | $returnArray['status'] = $status; |
71 | 71 | $returnArray['data'] = $data; |
72 | - $returnArray['tou'] = "Please consult Terms of Use at: //" . $host . \core\CAT::getRootUrlPath() . "/tou.php"; |
|
72 | + $returnArray['tou'] = "Please consult Terms of Use at: //".$host.\core\CAT::getRootUrlPath()."/tou.php"; |
|
73 | 73 | if (!empty($otherData)) { |
74 | 74 | $returnArray['otherdata'] = $otherData; |
75 | 75 | } |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | public function sendLogo($identifier, $type, $width, $height) |
312 | 312 | { |
313 | 313 | $logo = $this->getLogo($identifier, $type, $width, $height); |
314 | - $blob = $logo === NULL ? file_get_contents(ROOT . '/web/resources/images/empty.png') : $logo['blob']; |
|
315 | - header("Content-type: " . $logo['filetype']); |
|
314 | + $blob = $logo === NULL ? file_get_contents(ROOT.'/web/resources/images/empty.png') : $logo['blob']; |
|
315 | + header("Content-type: ".$logo['filetype']); |
|
316 | 316 | header("Cache-Control:max-age=36000, must-revalidate"); |
317 | 317 | header($logo['expires']); |
318 | 318 | echo $blob; |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | parent::__construct(); |
66 | 66 | $Dev = \devices\Devices::listDevices(); |
67 | 67 | if (isset($Dev[$blueprint])) { |
68 | - $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n"); |
|
69 | - $class_name = "\devices\\" . $Dev[$blueprint]['directory'] . "\Device" . $Dev[$blueprint]['module']; |
|
68 | + $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n"); |
|
69 | + $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device".$Dev[$blueprint]['module']; |
|
70 | 70 | $this->device = new $class_name(); |
71 | 71 | if (!$this->device) { |
72 | 72 | $this->loggerInstance->debug(2, "module loading failed"); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } else { |
76 | 76 | echo("unknown devicename:$blueprint\n"); |
77 | 77 | } |
78 | - $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory']; |
|
78 | + $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory']; |
|
79 | 79 | $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0; |
80 | 80 | $this->device->device_id = $blueprint; |
81 | 81 | $options = \devices\Devices::$Options; |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | class CertificationAuthorityEmbeddedRSA extends EntityWithDBProperties implements CertificationAuthorityInterface |
17 | 17 | { |
18 | 18 | |
19 | - private const LOCATION_ROOT_CA = ROOT . "/config/SilverbulletClientCerts/rootca-RSA.pem"; |
|
20 | - private const LOCATION_ISSUING_CA = ROOT . "/config/SilverbulletClientCerts/real-RSA.pem"; |
|
21 | - private const LOCATION_ISSUING_KEY = ROOT . "/config/SilverbulletClientCerts/real-RSA.key"; |
|
22 | - private const LOCATION_CONFIG = ROOT . "/config/SilverbulletClientCerts/openssl-RSA.cnf"; |
|
19 | + private const LOCATION_ROOT_CA = ROOT."/config/SilverbulletClientCerts/rootca-RSA.pem"; |
|
20 | + private const LOCATION_ISSUING_CA = ROOT."/config/SilverbulletClientCerts/real-RSA.pem"; |
|
21 | + private const LOCATION_ISSUING_KEY = ROOT."/config/SilverbulletClientCerts/real-RSA.key"; |
|
22 | + private const LOCATION_CONFIG = ROOT."/config/SilverbulletClientCerts/openssl-RSA.cnf"; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * string with the PEM variant of the root CA |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | parent::__construct(); |
67 | 67 | $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA); |
68 | 68 | if ($this->rootPem === FALSE) { |
69 | - throw new Exception("Root CA PEM file not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA); |
|
69 | + throw new Exception("Root CA PEM file not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA); |
|
70 | 70 | } |
71 | 71 | $this->issuingCertRaw = file_get_contents(CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA); |
72 | 72 | if ($this->issuingCertRaw === FALSE) { |
73 | - throw new Exception("Issuing CA PEM file not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA); |
|
73 | + throw new Exception("Issuing CA PEM file not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA); |
|
74 | 74 | } |
75 | 75 | $rootParsed = openssl_x509_read($this->rootPem); |
76 | 76 | $this->issuingCert = openssl_x509_read($this->issuingCertRaw); |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | throw new Exception("At least one CA PEM file did not parse correctly!"); |
79 | 79 | } |
80 | 80 | if (stat(CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY) === FALSE) { |
81 | - throw new Exception("Private key not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY); |
|
81 | + throw new Exception("Private key not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY); |
|
82 | 82 | } |
83 | - $issuingKeyTemp = openssl_pkey_get_private("file://" . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY); |
|
83 | + $issuingKeyTemp = openssl_pkey_get_private("file://".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY); |
|
84 | 84 | if ($issuingKeyTemp === FALSE) { |
85 | 85 | throw new Exception("The private key did not parse correctly!"); |
86 | 86 | } |
87 | 87 | $this->issuingKey = $issuingKeyTemp; |
88 | 88 | if (stat(CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG) === FALSE) { |
89 | - throw new Exception("openssl configuration not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG); |
|
89 | + throw new Exception("openssl configuration not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG); |
|
90 | 90 | } |
91 | 91 | $this->conffile = CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG; |
92 | 92 | } |
@@ -129,27 +129,27 @@ discard block |
||
129 | 129 | // generate stub index.txt file |
130 | 130 | $tempdirArray = \core\common\Entity::createTemporaryDirectory("test"); |
131 | 131 | $tempdir = $tempdirArray['dir']; |
132 | - $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z"; |
|
133 | - $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z"; |
|
132 | + $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z"; |
|
133 | + $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z"; |
|
134 | 134 | // serials for our CA are always integers |
135 | 135 | $serialHex = strtoupper(dechex((int) $cert->serial)); |
136 | 136 | if (strlen($serialHex) % 2 == 1) { |
137 | - $serialHex = "0" . $serialHex; |
|
137 | + $serialHex = "0".$serialHex; |
|
138 | 138 | } |
139 | 139 | |
140 | - $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$federation/CN=$cert->username\n"; |
|
140 | + $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$federation/CN=$cert->username\n"; |
|
141 | 141 | $this->loggerInstance->debug(4, "index.txt contents-to-be: $indexStatement"); |
142 | - if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) { |
|
142 | + if (!file_put_contents($tempdir."/index.txt", $indexStatement)) { |
|
143 | 143 | $this->loggerInstance->debug(1, "Unable to write openssl index.txt file for revocation handling!"); |
144 | 144 | } |
145 | 145 | // index.txt.attr is dull but needs to exist |
146 | - file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n"); |
|
146 | + file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n"); |
|
147 | 147 | // call "openssl ocsp" to manufacture our own OCSP statement |
148 | 148 | // adding "-rmd sha1" to the following command-line makes the |
149 | 149 | // choice of signature algorithm for the response explicit |
150 | 150 | // but it's only available from openssl-1.1.0 (which we do not |
151 | 151 | // want to require just for that one thing). |
152 | - $execCmd = \config\Master::PATHS['openssl'] . " ocsp -issuer " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -rsigner " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -rkey " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY . " -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der"; |
|
152 | + $execCmd = \config\Master::PATHS['openssl']." ocsp -issuer ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -rsigner ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -rkey ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY." -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der"; |
|
153 | 153 | $this->loggerInstance->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n"); |
154 | 154 | $output = []; |
155 | 155 | $return = 999; |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | if ($return !== 0) { |
158 | 158 | throw new Exception("Non-zero return value from openssl ocsp!"); |
159 | 159 | } |
160 | - $ocsp = file_get_contents($tempdir . "/$serialHex.response.der"); |
|
160 | + $ocsp = file_get_contents($tempdir."/$serialHex.response.der"); |
|
161 | 161 | // remove the temp dir! |
162 | - unlink($tempdir . "/$serialHex.response.der"); |
|
163 | - unlink($tempdir . "/index.txt.attr"); |
|
164 | - unlink($tempdir . "/index.txt"); |
|
162 | + unlink($tempdir."/$serialHex.response.der"); |
|
163 | + unlink($tempdir."/index.txt.attr"); |
|
164 | + unlink($tempdir."/index.txt"); |
|
165 | 165 | rmdir($tempdir); |
166 | 166 | $this->databaseHandle->exec("UPDATE silverbullet_certificate SET OCSP = ?, OCSP_timestamp = NOW() WHERE serial_number = ?", "si", $ocsp, $cert->serial); |
167 | 167 | return $ocsp; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->test_result = []; |
123 | 123 | $this->test_result['global'] = 0; |
124 | 124 | // parse the schema file to find out the number of expected rows... |
125 | - $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql"); |
|
125 | + $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql"); |
|
126 | 126 | $this->profileOptionCount = 0; |
127 | 127 | $passedTheWindmill = FALSE; |
128 | 128 | foreach ($schema as $schemaLine) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | { |
150 | 150 | $this->out[$test] = []; |
151 | 151 | $this->name = $test; |
152 | - $m_name = 'test' . $test; |
|
152 | + $m_name = 'test'.$test; |
|
153 | 153 | $this->test_result[$test] = 0; |
154 | 154 | if (!method_exists($this, $m_name)) { |
155 | 155 | $this->storeTestResult(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>."); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $matchArray = []; |
243 | 243 | preg_match('/([^ ]+) ?/', $config[$pathToCheck], $matchArray); |
244 | 244 | $exe = $matchArray[1]; |
245 | - $the_path = exec("which " . $config[$pathToCheck]); |
|
245 | + $the_path = exec("which ".$config[$pathToCheck]); |
|
246 | 246 | if ($the_path == $exe) { |
247 | 247 | $exec_is = "EXPLICIT"; |
248 | 248 | } else { |
@@ -262,9 +262,9 @@ discard block |
||
262 | 262 | private function testPhp() |
263 | 263 | { |
264 | 264 | if (version_compare(phpversion(), $this->needversionPHP, '>=')) { |
265 | - $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
265 | + $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
266 | 266 | } else { |
267 | - $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have " . phpversion() . "."); |
|
267 | + $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have ".phpversion()."."); |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
282 | 282 | } else { |
283 | 283 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
284 | - $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . \config\Master::PATHS['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>"); |
|
284 | + $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".\config\Master::PATHS['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>"); |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | if (count($probeReturns) == 0) { |
303 | 303 | $this->storeTestResult(common\Entity::L_OK, "All configured RADIUS/UDP probes are reachable."); |
304 | 304 | } else { |
305 | - $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: " . implode(', ', $probeReturns)); |
|
305 | + $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ', $probeReturns)); |
|
306 | 306 | } |
307 | 307 | } |
308 | 308 | |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | $SSPconfig = \SimpleSAML\Configuration::getInstance(); |
321 | 321 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
322 | 322 | if ((int) $sspVersion[0] >= $this->needversionSSP['major'] && (int) $sspVersion[1] >= $this->needversionSSP['minor']) { |
323 | - $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
323 | + $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
324 | 324 | } else { |
325 | - $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->needversionSSP)); |
|
325 | + $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->needversionSSP)); |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | } |
@@ -380,8 +380,8 @@ discard block |
||
380 | 380 | */ |
381 | 381 | private function testLogdir() |
382 | 382 | { |
383 | - if (fopen(\config\Master::PATHS['logdir'] . "/debug.log", "a") == FALSE) { |
|
384 | - $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::PATHS['logdir'] . "</strong> are not writable!"); |
|
383 | + if (fopen(\config\Master::PATHS['logdir']."/debug.log", "a") == FALSE) { |
|
384 | + $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::PATHS['logdir']."</strong> are not writable!"); |
|
385 | 385 | } else { |
386 | 386 | $this->storeTestResult(\core\common\Entity::L_OK, "Log directory is writable."); |
387 | 387 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $classname = 'Imagick'; |
421 | 421 | } |
422 | 422 | |
423 | - if (class_exists('\\' . $classname)) { |
|
423 | + if (class_exists('\\'.$classname)) { |
|
424 | 424 | $this->storeTestResult(\core\common\Entity::L_OK, "PHP extension <strong>Imagick</strong> is installed."); |
425 | 425 | } else { |
426 | 426 | $this->storeTestResult(\core\common\Entity::L_ERROR, "PHP extension <strong>Imagick</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/package/imagick'>here</a>."); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | { |
517 | 517 | $A = $this->getExecPath('openssl'); |
518 | 518 | if ($A['exec'] != "") { |
519 | - $t = exec($A['exec'] . ' version'); |
|
519 | + $t = exec($A['exec'].' version'); |
|
520 | 520 | if ($A['exec_is'] == "EXPLICIT") { |
521 | 521 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config."); |
522 | 522 | } else { |
@@ -544,14 +544,14 @@ discard block |
||
544 | 544 | } |
545 | 545 | $A = $this->getExecPath('makensis'); |
546 | 546 | if ($A['exec'] != "") { |
547 | - $t = exec($A['exec'] . ' -VERSION'); |
|
547 | + $t = exec($A['exec'].' -VERSION'); |
|
548 | 548 | if ($A['exec_is'] == "EXPLICIT") { |
549 | 549 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config."); |
550 | 550 | } else { |
551 | 551 | $this->storeTestResult(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
552 | 552 | } |
553 | 553 | $outputArray = []; |
554 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
554 | + exec($A['exec'].' -HELP', $outputArray); |
|
555 | 555 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
556 | 556 | if ($t1 == 1 && \config\ConfAssistant::NSIS_VERSION == 2) { |
557 | 557 | $this->storeTestResult(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | $NSIS_Module_status = []; |
582 | 582 | foreach ($this->NSISModules as $module) { |
583 | 583 | unset($out); |
584 | - exec(\config\ConfAssistant::PATHS['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
584 | + exec(\config\ConfAssistant::PATHS['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
585 | 585 | if ($retval > 0) { |
586 | 586 | $NSIS_Module_status[$module] = 0; |
587 | 587 | } else { |
@@ -646,8 +646,8 @@ discard block |
||
646 | 646 | $locales = shell_exec("locale -a"); |
647 | 647 | $allthere = ""; |
648 | 648 | foreach (\config\Master::LANGUAGES as $onelanguage) { |
649 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
650 | - $allthere .= $onelanguage['locale'] . " "; |
|
649 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
650 | + $allthere .= $onelanguage['locale']." "; |
|
651 | 651 | } |
652 | 652 | } |
653 | 653 | if ($allthere == "") { |
@@ -661,47 +661,47 @@ discard block |
||
661 | 661 | ["SETTING" => \config\Master::APPEARANCE['from-mail'], |
662 | 662 | "DEFVALUE" => "[email protected]", |
663 | 663 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
664 | - "REQUIRED" => FALSE,], |
|
664 | + "REQUIRED" => FALSE, ], |
|
665 | 665 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['url'], |
666 | 666 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
667 | 667 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
668 | - "REQUIRED" => FALSE,], |
|
668 | + "REQUIRED" => FALSE, ], |
|
669 | 669 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['display'], |
670 | 670 | "DEFVALUE" => "[email protected]", |
671 | 671 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
672 | - "REQUIRED" => FALSE,], |
|
672 | + "REQUIRED" => FALSE, ], |
|
673 | 673 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['developer-mail'], |
674 | 674 | "DEFVALUE" => "[email protected]", |
675 | 675 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
676 | - "REQUIRED" => FALSE,], |
|
676 | + "REQUIRED" => FALSE, ], |
|
677 | 677 | ["SETTING" => \config\Master::APPEARANCE['abuse-mail'], |
678 | 678 | "DEFVALUE" => "[email protected]", |
679 | 679 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
680 | - "REQUIRED" => FALSE,], |
|
680 | + "REQUIRED" => FALSE, ], |
|
681 | 681 | ["SETTING" => \config\Master::APPEARANCE['MOTD'], |
682 | 682 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
683 | 683 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
684 | - "REQUIRED" => FALSE,], |
|
684 | + "REQUIRED" => FALSE, ], |
|
685 | 685 | ["SETTING" => \config\Master::APPEARANCE['webcert_CRLDP'], |
686 | 686 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
687 | 687 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
688 | - "REQUIRED" => TRUE,], |
|
688 | + "REQUIRED" => TRUE, ], |
|
689 | 689 | ["SETTING" => \config\Master::APPEARANCE['webcert_OCSP'], |
690 | 690 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
691 | 691 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
692 | - "REQUIRED" => TRUE,], |
|
692 | + "REQUIRED" => TRUE, ], |
|
693 | 693 | ["SETTING" => \config\Master::DB['INST']['host'], |
694 | 694 | "DEFVALUE" => "db.host.example", |
695 | 695 | "COMPLAINTSTRING" => "DB/INST ", |
696 | - "REQUIRED" => TRUE,], |
|
696 | + "REQUIRED" => TRUE, ], |
|
697 | 697 | ["SETTING" => \config\Master::DB['INST']['host'], |
698 | 698 | "DEFVALUE" => "db.host.example", |
699 | 699 | "COMPLAINTSTRING" => "DB/USER ", |
700 | - "REQUIRED" => TRUE,], |
|
700 | + "REQUIRED" => TRUE, ], |
|
701 | 701 | ["SETTING" => \config\Master::DB['EXTERNAL']['host'], |
702 | 702 | "DEFVALUE" => "customerdb.otherhost.example", |
703 | 703 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
704 | - "REQUIRED" => FALSE,], |
|
704 | + "REQUIRED" => FALSE, ], |
|
705 | 705 | ]; |
706 | 706 | |
707 | 707 | /** |
@@ -730,11 +730,11 @@ discard block |
||
730 | 730 | if (isset(\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'])) { |
731 | 731 | foreach (\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'] as $cadata) { |
732 | 732 | foreach ($cadata['certificates'] as $cert_files) { |
733 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
734 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
733 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
734 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
735 | 735 | } |
736 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
737 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
736 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
737 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
738 | 738 | } |
739 | 739 | } |
740 | 740 | } |
@@ -827,14 +827,14 @@ discard block |
||
827 | 827 | if ($global_no_cache) { |
828 | 828 | foreach ($Devs as $dev => $D) { |
829 | 829 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
830 | - $no_cache_dev .= $dev . " "; |
|
830 | + $no_cache_dev .= $dev." "; |
|
831 | 831 | $no_cache_dev_count++; |
832 | 832 | } |
833 | 833 | } |
834 | 834 | } else { |
835 | 835 | foreach ($Devs as $dev => $D) { |
836 | 836 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
837 | - $no_cache_dev .= $dev . " "; |
|
837 | + $no_cache_dev .= $dev." "; |
|
838 | 838 | $no_cache_dev_count++; |
839 | 839 | } |
840 | 840 | } |
@@ -873,13 +873,13 @@ discard block |
||
873 | 873 | $mail->isHTML(FALSE); |
874 | 874 | $mail->CharSet = 'UTF-8'; |
875 | 875 | $mail->From = \config\Master::APPEARANCE['from-mail']; |
876 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System"; |
|
876 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System"; |
|
877 | 877 | $mail->addAddress(\config\Master::APPEARANCE['abuse-mail']); |
878 | 878 | $mail->Subject = "testing CAT configuration mail"; |
879 | 879 | $mail->Body = "Testing CAT mailing\n"; |
880 | 880 | $sent = $mail->send(); |
881 | 881 | if ($sent) { |
882 | - $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . \config\Master::APPEARANCE['abuse-mail'] . " mailbox if the message was receiced."); |
|
882 | + $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".\config\Master::APPEARANCE['abuse-mail']." mailbox if the message was receiced."); |
|
883 | 883 | } else { |
884 | 884 | $this->storeTestResult(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
885 | 885 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | "TXT" => _("If you use more than one device: do your other devices still work?"), |
109 | 109 | "FACTOR_YES" => 0.33, // seems that all is okay with the account as such |
110 | 110 | "FACTOR_NO" => 3, // now that is suspicious indeed |
111 | - "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"),], |
|
111 | + "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"), ], |
|
112 | 112 | 6 => ["AREA" => AbstractTest::INFRA_SP_80211, |
113 | 113 | "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), |
114 | 114 | "FACTOR_YES" => 3, |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | $questionDetails = $this->qaArray[$questionNumber]; |
145 | 145 | if ($answer === TRUE) { |
146 | 146 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_YES"]; |
147 | - $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_YES"] . "\n"); |
|
147 | + $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_YES"]."\n"); |
|
148 | 148 | $factor = $questionDetails["FACTOR_YES"]; |
149 | 149 | } elseif ($answer === FALSE) { |
150 | 150 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR_NO"]; |
151 | - $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_NO"] . "\n"); |
|
151 | + $this->loggerInstance->debug(3, "Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR_NO"]."\n"); |
|
152 | 152 | $factor = $questionDetails["FACTOR_NO"]; |
153 | 153 | } else { |
154 | 154 | $factor = 1; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | // if both are identical, take any of the questions in the pool of both |
184 | 184 | foreach ($this->qaArray as $questionNumber => $questionDetails) { |
185 | 185 | // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it |
186 | - if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
186 | + if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
187 | 187 | return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]); |
188 | 188 | } |
189 | 189 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $text = $this->genericVerdictTexts[$area]; |
212 | 212 | foreach ($this->previousQuestions as $number => $factor) { |
213 | 213 | if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) { |
214 | - $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"]; |
|
214 | + $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"]; |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | return $text; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | - $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true)); |
|
170 | + $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true)); |
|
171 | 171 | $this->loggerInstance->debug(4, print_r($expectedServerNames, true)); |
172 | 172 | $this->loggerInstance->debug(4, print_r($expectedCABundle, true)); |
173 | 173 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME; |
258 | 258 | continue; // otherwise we'd ALSO complain that it's not a real hostname |
259 | 259 | } |
260 | - if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) { |
|
260 | + if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) { |
|
261 | 261 | $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME; |
262 | 262 | } |
263 | 263 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $probValue = RADIUSTests::CERTPROB_SHA1_SIGNATURE; |
285 | 285 | $returnarray[] = $probValue; |
286 | 286 | } |
287 | - $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE)); |
|
287 | + $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE)); |
|
288 | 288 | if ($intermediateCa['basicconstraints_set'] == 0) { |
289 | 289 | $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS; |
290 | 290 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | { |
335 | 335 | // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy |
336 | 336 | // the following PEM data is one of the SENSE EAPLab client certs (not secret at all) |
337 | - $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12"); |
|
337 | + $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12"); |
|
338 | 338 | if ($clientcert === FALSE) { |
339 | 339 | throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!"); |
340 | 340 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) { |
344 | 344 | return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert); |
345 | 345 | } |
346 | - return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert); |
|
346 | + return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | return RADIUSTests::CERTPROB_NO_CDP_HTTP; |
366 | 366 | } |
367 | 367 | // first and second sub-match is the full URL... check it |
368 | - $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2])); |
|
368 | + $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2])); |
|
369 | 369 | if ($crlcontent === FALSE) { |
370 | 370 | return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL; |
371 | 371 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | // $pem = chunk_split(base64_encode($crlcontent), 64, "\n"); |
381 | 381 | // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php |
382 | 382 | |
383 | - $proc = \config\Master::PATHS['openssl'] . " crl -inform der"; |
|
383 | + $proc = \config\Master::PATHS['openssl']." crl -inform der"; |
|
384 | 384 | $descriptorspec = [ |
385 | 385 | 0 => ["pipe", "r"], |
386 | 386 | 1 => ["pipe", "w"], |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | $origLength = strlen($hex); |
420 | 420 | for ($i = 1; $i < $origLength; $i++) { |
421 | 421 | if ($i % 2 == 1 && $i != strlen($hex)) { |
422 | - $spaced .= $hex[$i] . " "; |
|
422 | + $spaced .= $hex[$i]." "; |
|
423 | 423 | } else { |
424 | 424 | $spaced .= $hex[$i]; |
425 | 425 | } |
@@ -547,19 +547,19 @@ discard block |
||
547 | 547 | $eapText = \core\common\EAP::eapDisplayName($eaptype); |
548 | 548 | $config = ' |
549 | 549 | network={ |
550 | - ssid="' . \config\Master::APPEARANCE['productname'] . ' testing" |
|
550 | + ssid="' . \config\Master::APPEARANCE['productname'].' testing" |
|
551 | 551 | key_mgmt=WPA-EAP |
552 | 552 | proto=WPA2 |
553 | 553 | pairwise=CCMP |
554 | 554 | group=CCMP |
555 | 555 | '; |
556 | 556 | // phase 1 |
557 | - $config .= 'eap=' . $eapText['OUTER'] . "\n"; |
|
557 | + $config .= 'eap='.$eapText['OUTER']."\n"; |
|
558 | 558 | $logConfig = $config; |
559 | 559 | // phase 2 if applicable; all inner methods have passwords |
560 | 560 | if (isset($eapText['INNER']) && $eapText['INNER'] != "") { |
561 | - $config .= ' phase2="auth=' . $eapText['INNER'] . "\"\n"; |
|
562 | - $logConfig .= ' phase2="auth=' . $eapText['INNER'] . "\"\n"; |
|
561 | + $config .= ' phase2="auth='.$eapText['INNER']."\"\n"; |
|
562 | + $logConfig .= ' phase2="auth='.$eapText['INNER']."\"\n"; |
|
563 | 563 | } |
564 | 564 | // all methods set a password, except EAP-TLS |
565 | 565 | if ($eaptype != \core\common\EAP::EAPTYPE_TLS) { |
@@ -575,11 +575,11 @@ discard block |
||
575 | 575 | } |
576 | 576 | |
577 | 577 | // inner identity |
578 | - $config .= ' identity="' . $inner . "\"\n"; |
|
579 | - $logConfig .= ' identity="' . $inner . "\"\n"; |
|
578 | + $config .= ' identity="'.$inner."\"\n"; |
|
579 | + $logConfig .= ' identity="'.$inner."\"\n"; |
|
580 | 580 | // outer identity, may be equal |
581 | - $config .= ' anonymous_identity="' . $outer . "\"\n"; |
|
582 | - $logConfig .= ' anonymous_identity="' . $outer . "\"\n"; |
|
581 | + $config .= ' anonymous_identity="'.$outer."\"\n"; |
|
582 | + $logConfig .= ' anonymous_identity="'.$outer."\"\n"; |
|
583 | 583 | // done |
584 | 584 | $config .= "}"; |
585 | 585 | $logConfig .= "}"; |
@@ -642,13 +642,13 @@ discard block |
||
642 | 642 | */ |
643 | 643 | private function eapolTestConfig($probeindex, $opName, $frag) |
644 | 644 | { |
645 | - $cmdline = \config\Diagnostics::PATHS['eapol_test'] . |
|
646 | - " -a " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['ip'] . |
|
647 | - " -s " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['secret'] . |
|
648 | - " -o serverchain.pem" . |
|
649 | - " -c ./udp_login_test.conf" . |
|
650 | - " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " . |
|
651 | - " -t " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['timeout'] . " "; |
|
645 | + $cmdline = \config\Diagnostics::PATHS['eapol_test']. |
|
646 | + " -a ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['ip']. |
|
647 | + " -s ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['secret']. |
|
648 | + " -o serverchain.pem". |
|
649 | + " -c ./udp_login_test.conf". |
|
650 | + " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ". |
|
651 | + " -t ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['timeout']." "; |
|
652 | 652 | if ($opName) { |
653 | 653 | $cmdline .= '-N126:s:"1cat.eduroam.org" '; |
654 | 654 | } |
@@ -678,10 +678,10 @@ discard block |
||
678 | 678 | */ |
679 | 679 | private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) |
680 | 680 | { |
681 | - if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) { |
|
681 | + if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) { |
|
682 | 682 | throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n"); |
683 | 683 | } |
684 | - if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) { |
|
684 | + if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) { |
|
685 | 685 | throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n"); |
686 | 686 | } |
687 | 687 | // make a copy of the EAP-received chain and add the configured intermediates, if any |
@@ -695,15 +695,15 @@ discard block |
||
695 | 695 | } |
696 | 696 | if ($decoded['ca'] == 1) { |
697 | 697 | if ($decoded['root'] == 1) { // save CAT roots to the root directory |
698 | - file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']); |
|
699 | - file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']); |
|
698 | + file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']); |
|
699 | + file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']); |
|
700 | 700 | $catRoots[] = $decoded['pem']; |
701 | 701 | } else { // save the intermediates to allcerts directory |
702 | - file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']); |
|
702 | + file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']); |
|
703 | 703 | $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded)); |
704 | 704 | if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) { |
705 | 705 | $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain"); |
706 | - file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]); |
|
706 | + file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]); |
|
707 | 707 | } |
708 | 708 | $catIntermediates[] = $decoded['pem']; |
709 | 709 | } |
@@ -712,26 +712,26 @@ discard block |
||
712 | 712 | // save all intermediate certificates and CRLs to separate files in |
713 | 713 | // both root-ca directories |
714 | 714 | foreach ($eapIntermediates as $index => $onePem) { |
715 | - file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem); |
|
716 | - file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem); |
|
715 | + file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem); |
|
716 | + file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem); |
|
717 | 717 | } |
718 | 718 | foreach ($eapIntermediateCRLs as $index => $onePem) { |
719 | - file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem); |
|
720 | - file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem); |
|
719 | + file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem); |
|
720 | + file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem); |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | $checkstring = ""; |
724 | 724 | if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) { |
725 | 725 | $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain"); |
726 | 726 | $checkstring = "-crl_check_all"; |
727 | - file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]); |
|
728 | - file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]); |
|
727 | + file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]); |
|
728 | + file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | |
732 | 732 | // now c_rehash the root CA directory ... |
733 | - system(\config\Diagnostics::PATHS['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null"); |
|
734 | - system(\config\Diagnostics::PATHS['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null"); |
|
733 | + system(\config\Diagnostics::PATHS['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null"); |
|
734 | + system(\config\Diagnostics::PATHS['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null"); |
|
735 | 735 | return $checkstring; |
736 | 736 | } |
737 | 737 | |
@@ -763,12 +763,12 @@ discard block |
||
763 | 763 | // the error log will complain if we run this test against an empty file of certs |
764 | 764 | // so test if there's something PEMy in the file at all |
765 | 765 | if (filesize("$tmpDir/serverchain.pem") > 10) { |
766 | - exec(\config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
767 | - $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n"); |
|
768 | - $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n"); |
|
769 | - exec(\config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
770 | - $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n"); |
|
771 | - $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n"); |
|
766 | + exec(\config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
767 | + $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n"); |
|
768 | + $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n"); |
|
769 | + exec(\config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
770 | + $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n"); |
|
771 | + $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n"); |
|
772 | 772 | } |
773 | 773 | |
774 | 774 | |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | // we are UNHAPPY if no names match! |
836 | 836 | $happiness = "UNHAPPY"; |
837 | 837 | foreach ($this->expectedServerNames as $expectedName) { |
838 | - $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE)); |
|
838 | + $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE)); |
|
839 | 839 | if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) { |
840 | 840 | $this->loggerInstance->debug(4, "Totally happy!"); |
841 | 841 | $happiness = "TOTALLY"; |
@@ -880,11 +880,11 @@ discard block |
||
880 | 880 | $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password); |
881 | 881 | // the config intentionally does not include CA checking. We do this |
882 | 882 | // ourselves after getting the chain with -o. |
883 | - file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]); |
|
883 | + file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]); |
|
884 | 884 | |
885 | 885 | $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag); |
886 | 886 | $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n"); |
887 | - $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n"); |
|
887 | + $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n"); |
|
888 | 888 | $time_start = microtime(true); |
889 | 889 | $pflow = []; |
890 | 890 | exec($cmdline, $pflow); |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) { |
929 | 929 | array_pop($packetflow); |
930 | 930 | } |
931 | - $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE)); |
|
931 | + $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE)); |
|
932 | 932 | $packetcount = array_count_values($packetflow); |
933 | 933 | $testresults['packetcount'] = $packetcount; |
934 | 934 | $testresults['packetflow'] = $packetflow; |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | private function wasModernTlsNegotiated(&$testresults, $packetflow_orig) |
971 | 971 | { |
972 | 972 | $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION); |
973 | - $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion" . "\n"); |
|
973 | + $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n"); |
|
974 | 974 | if ($negotiatedTlsVersion === FALSE) { |
975 | 975 | $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION; |
976 | 976 | } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) { |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | |
1031 | 1031 | $x509 = new \core\common\X509(); |
1032 | 1032 | // $eap_certarray holds all certs received in EAP conversation |
1033 | - $incomingData = file_get_contents($tmpDir . "/serverchain.pem"); |
|
1033 | + $incomingData = file_get_contents($tmpDir."/serverchain.pem"); |
|
1034 | 1034 | if ($incomingData !== FALSE && strlen($incomingData) > 0) { |
1035 | 1035 | $eapCertArray = $x509->splitCertificate($incomingData); |
1036 | 1036 | } else { |
@@ -1060,10 +1060,10 @@ discard block |
||
1060 | 1060 | case RADIUSTests::SERVER_CA_SELFSIGNED: |
1061 | 1061 | $servercert[] = $cert; |
1062 | 1062 | if (count($servercert) == 1) { |
1063 | - if (file_put_contents($tmpDir . "/incomingserver.pem", $cert['pem'] . "\n") === FALSE) { |
|
1063 | + if (file_put_contents($tmpDir."/incomingserver.pem", $cert['pem']."\n") === FALSE) { |
|
1064 | 1064 | $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n"); |
1065 | 1065 | } |
1066 | - $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true)); |
|
1066 | + $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true)); |
|
1067 | 1067 | } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) { |
1068 | 1068 | $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS; |
1069 | 1069 | } |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | chdir($tmpDir); |
1145 | 1145 | $this->loggerInstance->debug(4, "temp dir: $tmpDir\n"); |
1146 | 1146 | if ($clientcertdata !== NULL) { |
1147 | - file_put_contents($tmpDir . "/client.p12", $clientcertdata); |
|
1147 | + file_put_contents($tmpDir."/client.p12", $clientcertdata); |
|
1148 | 1148 | } |
1149 | 1149 | $testresults = []; |
1150 | 1150 | // initialise the sub-array for cleaner parsing |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | 'issuer' => $this->printDN($certdata['issuer']), |
1246 | 1246 | 'validFrom' => $this->printTm($certdata['validFrom_time_t']), |
1247 | 1247 | 'validTo' => $this->printTm($certdata['validTo_time_t']), |
1248 | - 'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']), |
|
1248 | + 'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']), |
|
1249 | 1249 | 'sha1' => $certdata['sha1'], |
1250 | 1250 | 'extensions' => $certdata['extensions'] |
1251 | 1251 | ]; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if ($this->idPFederation === NULL && preg_match("/\.(..)$/", $realm, $matches)) { |
114 | 114 | $this->idPFederation = strtoupper($matches[1]); |
115 | 115 | } |
116 | - $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is " . $this->idPFederation . "\n"); |
|
116 | + $this->loggerInstance->debug(4, "XYZ: IdP-side NRO is ".$this->idPFederation."\n"); |
|
117 | 117 | } |
118 | 118 | /* The eduroam OT monitoring has the following return codes: |
119 | 119 | * |
@@ -443,12 +443,12 @@ discard block |
||
443 | 443 | break; |
444 | 444 | case \core\AbstractProfile::READINESS_LEVEL_NOTREADY: |
445 | 445 | $this->additionalFindings[AbstractTest::INFRA_IDP_RADIUS][] = ["Profile" => "UNCONCLUSIVE"]; |
446 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
446 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
447 | 447 | break; |
448 | 448 | default: |
449 | 449 | } |
450 | 450 | } else { |
451 | - $this->testsuite = new RADIUSTests($this->realm, "anonymous@" . $this->realm); |
|
451 | + $this->testsuite = new RADIUSTests($this->realm, "anonymous@".$this->realm); |
|
452 | 452 | } |
453 | 453 | } |
454 | 454 |