|
@@ -121,7 +121,7 @@ discard block |
|
|
block discarded – undo |
|
121
|
121
|
$cryptoJson = openssl_encrypt($clearJson, 'AES-256-CBC', $encryptionKey, OPENSSL_RAW_DATA, $initVector); |
|
122
|
122
|
$hmac = hash_hmac("sha1", $cryptoJson, $encryptionKey, TRUE); |
|
123
|
123
|
|
|
124
|
|
- $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)); |
|
|
124
|
+ $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)); |
|
125
|
125
|
|
|
126
|
126
|
// now, generate the container that holds all the crypto data |
|
127
|
127
|
$finalArray = [ |
|
@@ -195,7 +195,7 @@ discard block |
|
|
block discarded – undo |
|
195
|
195
|
private function wiredBlock($eapdetails) |
|
196
|
196
|
{ |
|
197
|
197
|
return [ |
|
198
|
|
- "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet") . "}", |
|
|
198
|
+ "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet")."}", |
|
199
|
199
|
"Name" => "eduroam configuration (wired network)", |
|
200
|
200
|
"Remove" => false, |
|
201
|
201
|
"Type" => "Ethernet", |
|
@@ -236,7 +236,7 @@ discard block |
|
|
block discarded – undo |
|
236
|
236
|
// if silverbullet, we deliver the client cert inline |
|
237
|
237
|
|
|
238
|
238
|
if ($selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
|
239
|
|
- $eaparray['ClientCertRef'] = "[" . $this->clientCert['GUID'] . "]"; |
|
|
239
|
+ $eaparray['ClientCertRef'] = "[".$this->clientCert['GUID']."]"; |
|
240
|
240
|
$eaparray['ClientCertType'] = "Ref"; |
|
241
|
241
|
} |
|
242
|
242
|
|
|
@@ -271,7 +271,7 @@ discard block |
|
|
block discarded – undo |
|
271
|
271
|
$jsonArray = ["Type" => "UnencryptedConfiguration"]; |
|
272
|
272
|
|
|
273
|
273
|
foreach ($this->attributes['internal:CAs'][0] as $ca) { |
|
274
|
|
- $caRefs[] = "{" . $ca['uuid'] . "}"; |
|
|
274
|
+ $caRefs[] = "{".$ca['uuid']."}"; |
|
275
|
275
|
} |
|
276
|
276
|
// define CA certificates |
|
277
|
277
|
foreach ($this->attributes['internal:CAs'][0] as $ca) { |
|
@@ -281,15 +281,15 @@ discard block |
|
|
block discarded – undo |
|
281
|
281
|
if ($caSanitized1 === FALSE) { |
|
282
|
282
|
throw new Exception("Error cropping PEM data at its BEGIN marker."); |
|
283
|
283
|
} |
|
284
|
|
- $this->loggerInstance->debug(4, $caSanitized1 . "\n"); |
|
|
284
|
+ $this->loggerInstance->debug(4, $caSanitized1."\n"); |
|
285
|
285
|
// remove \n |
|
286
|
286
|
$caSanitized = str_replace("\n", "", $caSanitized1); |
|
287
|
|
- $jsonArray["Certificates"][] = ["GUID" => "{" . $ca['uuid'] . "}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
288
|
|
- $this->loggerInstance->debug(3, $caSanitized . "\n"); |
|
|
287
|
+ $jsonArray["Certificates"][] = ["GUID" => "{".$ca['uuid']."}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
|
288
|
+ $this->loggerInstance->debug(3, $caSanitized."\n"); |
|
289
|
289
|
} |
|
290
|
290
|
// if we are doing silverbullet, include the unencrypted(!) P12 as a client certificate |
|
291
|
291
|
if ($this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
|
292
|
|
- $jsonArray["Certificates"][] = ["GUID" => "[" . $this->clientCert['GUID'] . "]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
|
292
|
+ $jsonArray["Certificates"][] = ["GUID" => "[".$this->clientCert['GUID']."]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
293
|
293
|
} |
|
294
|
294
|
$eaparray = $this->eapBlock($caRefs); |
|
295
|
295
|
// define Wi-Fi networks |
|
@@ -312,7 +312,7 @@ discard block |
|
|
block discarded – undo |
|
312
|
312
|
|
|
313
|
313
|
file_put_contents('installer_profile', $finalJson); |
|
314
|
314
|
|
|
315
|
|
- $fileName = $this->installerBasename . '.onc'; |
|
|
315
|
+ $fileName = $this->installerBasename.'.onc'; |
|
316
|
316
|
|
|
317
|
317
|
if (!$this->sign) { |
|
318
|
318
|
rename("installer_profile", $fileName); |
|
@@ -323,7 +323,7 @@ discard block |
|
|
block discarded – undo |
|
323
|
323
|
// have the notion of signing |
|
324
|
324
|
// but if they ever change their mind, we are prepared |
|
325
|
325
|
|
|
326
|
|
- $outputFromSigning = system($this->sign . " installer_profile '$fileName' > /dev/null"); |
|
|
326
|
+ $outputFromSigning = system($this->sign." installer_profile '$fileName' > /dev/null"); |
|
327
|
327
|
if ($outputFromSigning === FALSE) { |
|
328
|
328
|
$this->loggerInstance->debug(2, "Signing the ONC installer $fileName FAILED!\n"); |
|
329
|
329
|
} |