@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $cryptoJson = openssl_encrypt($clearJson, 'AES-256-CBC', $encryptionKey, OPENSSL_RAW_DATA, $initVector); |
| 83 | 83 | $hmac = hash_hmac("sha1", $cryptoJson, $encryptionKey, TRUE); |
| 84 | 84 | |
| 85 | - $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = " . $password . "\nb(IV) = " . base64_encode($initVector) . "\nb(Cipher) = " . base64_encode($cryptoJson) . "\nb(HMAC) = " . base64_encode($hmac)); |
|
| 85 | + $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = ".$password."\nb(IV) = ".base64_encode($initVector)."\nb(Cipher) = ".base64_encode($cryptoJson)."\nb(HMAC) = ".base64_encode($hmac)); |
|
| 86 | 86 | |
| 87 | 87 | // now, generate the container that holds all the crypto data |
| 88 | 88 | $finalArray = [ |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | private function wiredBlock($eapdetails) |
| 157 | 157 | { |
| 158 | 158 | return [ |
| 159 | - "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet") . "}", |
|
| 159 | + "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet")."}", |
|
| 160 | 160 | "Name" => "eduroam configuration (wired network)", |
| 161 | 161 | "Remove" => false, |
| 162 | 162 | "Type" => "Ethernet", |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | // if silverbullet, we deliver the client cert inline |
| 198 | 198 | |
| 199 | 199 | if ($selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
| 200 | - $eaparray['ClientCertRef'] = "[" . $this->clientCert['GUID'] . "]"; |
|
| 200 | + $eaparray['ClientCertRef'] = "[".$this->clientCert['GUID']."]"; |
|
| 201 | 201 | $eaparray['ClientCertType'] = "Ref"; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $jsonArray = ["Type" => "UnencryptedConfiguration"]; |
| 237 | 237 | |
| 238 | 238 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
| 239 | - $caRefs[] = "{" . $ca['uuid'] . "}"; |
|
| 239 | + $caRefs[] = "{".$ca['uuid']."}"; |
|
| 240 | 240 | } |
| 241 | 241 | // define CA certificates |
| 242 | 242 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
@@ -246,15 +246,15 @@ discard block |
||
| 246 | 246 | if ($caSanitized1 === FALSE) { |
| 247 | 247 | throw new Exception("Error cropping PEM data at its BEGIN marker."); |
| 248 | 248 | } |
| 249 | - $this->loggerInstance->debug(4, $caSanitized1 . "\n"); |
|
| 249 | + $this->loggerInstance->debug(4, $caSanitized1."\n"); |
|
| 250 | 250 | // remove \n |
| 251 | 251 | $caSanitized = str_replace("\n", "", $caSanitized1); |
| 252 | - $jsonArray["Certificates"][] = ["GUID" => "{" . $ca['uuid'] . "}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
| 253 | - $this->loggerInstance->debug(4, $caSanitized . "\n"); |
|
| 252 | + $jsonArray["Certificates"][] = ["GUID" => "{".$ca['uuid']."}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
| 253 | + $this->loggerInstance->debug(4, $caSanitized."\n"); |
|
| 254 | 254 | } |
| 255 | 255 | // if we are doing silverbullet, include the unencrypted(!) P12 as a client certificate |
| 256 | 256 | if ($this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
| 257 | - $jsonArray["Certificates"][] = ["GUID" => "[" . $this->clientCert['GUID'] . "]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
| 257 | + $jsonArray["Certificates"][] = ["GUID" => "[".$this->clientCert['GUID']."]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
| 258 | 258 | } |
| 259 | 259 | $eaparray = $this->eapBlock($caRefs); |
| 260 | 260 | // define Wi-Fi networks |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | file_put_contents('installer_profile', $finalJson); |
| 279 | 279 | |
| 280 | - $fileName = $this->installerBasename . '.onc'; |
|
| 280 | + $fileName = $this->installerBasename.'.onc'; |
|
| 281 | 281 | |
| 282 | 282 | if (!$this->sign) { |
| 283 | 283 | rename("installer_profile", $fileName); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | // have the notion of signing |
| 289 | 289 | // but if they ever change their mind, we are prepared |
| 290 | 290 | |
| 291 | - $outputFromSigning = system($this->sign . " installer_profile '$fileName' > /dev/null"); |
|
| 291 | + $outputFromSigning = system($this->sign." installer_profile '$fileName' > /dev/null"); |
|
| 292 | 292 | if ($outputFromSigning === FALSE) { |
| 293 | 293 | $this->loggerInstance->debug(2, "Signing the ONC installer $fileName FAILED!\n"); |
| 294 | 294 | } |
@@ -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(4, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_YES"] . "\n"); |
|
| 147 | + $this->loggerInstance->debug(4, "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(4, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR_NO"] . "\n"); |
|
| 151 | + $this->loggerInstance->debug(4, "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; |