@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | $retval = "<div class='sidebar'><p>"; |
67 | 67 | |
68 | 68 | if ($advancedControls) { |
69 | - $retval .= "<strong>" . _("You are:") . "</strong> ".$_SESSION['name'] |
|
69 | + $retval .= "<strong>"._("You are:")."</strong> ".$_SESSION['name'] |
|
70 | 70 | ."<br/> |
71 | 71 | <br/> |
72 | - <a href='" . \core\CAT::getRootUrlPath() . "/admin/overview_user.php'>" . _("Go to your Profile page") . "</a> |
|
73 | - <a href='" . \core\CAT::getRootUrlPath() . "/admin/inc/logout.php'>" . _("Logout") . "</a> "; |
|
72 | + <a href='" . \core\CAT::getRootUrlPath()."/admin/overview_user.php'>"._("Go to your Profile page")."</a> |
|
73 | + <a href='" . \core\CAT::getRootUrlPath()."/admin/inc/logout.php'>"._("Logout")."</a> "; |
|
74 | 74 | } |
75 | - $retval .= "<a href='" . \core\CAT::getRootUrlPath() . "/'>" . _("Start page") . "</a> |
|
75 | + $retval .= "<a href='".\core\CAT::getRootUrlPath()."/'>"._("Start page")."</a> |
|
76 | 76 | </p> |
77 | 77 | </div> <!-- sidebar -->"; |
78 | 78 | \core\common\Entity::outOfThePotatoes(); |
@@ -96,23 +96,23 @@ discard block |
||
96 | 96 | <h1>$cap1</h1> |
97 | 97 | </div><!--header_captions--> |
98 | 98 | <div id='langselection' style='padding-top:20px; padding-left:10px;'> |
99 | - <form action='$place' method='GET' accept-charset='UTF-8'>" . _("View this page in") . " |
|
99 | + <form action='$place' method='GET' accept-charset='UTF-8'>"._("View this page in")." |
|
100 | 100 | <select id='lang' name='lang' onchange='this.form.submit()'>"; |
101 | 101 | |
102 | 102 | foreach (\config\Main::LANGUAGES as $lang => $getValue) { |
103 | - $retval .= "<option value='$lang' " . (strtoupper($language) == strtoupper($lang) ? "selected" : "" ) . " >" . $getValue['display'] . "</option> "; |
|
103 | + $retval .= "<option value='$lang' ".(strtoupper($language) == strtoupper($lang) ? "selected" : "")." >".$getValue['display']."</option> "; |
|
104 | 104 | } |
105 | 105 | $retval .= "</select>"; |
106 | 106 | |
107 | 107 | foreach ($_GET as $getVar => $getValue) { |
108 | 108 | $filterValue = filter_input(INPUT_GET, $getVar, FILTER_SANITIZE_STRING); |
109 | 109 | if ($getVar != "lang" && $getValue != "") { |
110 | - $retval .= "<input type='hidden' name='" . htmlspecialchars($getVar) . "' value='" . htmlspecialchars($filterValue) . "'>"; |
|
110 | + $retval .= "<input type='hidden' name='".htmlspecialchars($getVar)."' value='".htmlspecialchars($filterValue)."'>"; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | $retval .= "</form> |
114 | 114 | </div><!--langselection-->"; |
115 | - $logoUrl = \core\CAT::getRootUrlPath() . "/resources/images/consortium_logo.png"; |
|
115 | + $logoUrl = \core\CAT::getRootUrlPath()."/resources/images/consortium_logo.png"; |
|
116 | 116 | $retval .= "<div class='consortium_logo'> |
117 | 117 | <img id='test_locate' src='$logoUrl' alt='Consortium Logo'> |
118 | 118 | </div> <!-- consortium_logo --> |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | if (isset(\config\Main::APPEARANCE['MOTD']) && \config\Main::APPEARANCE['MOTD'] != "") { |
207 | 207 | $retval .= "<div id='header_MOTD' style='display:inline-block; padding-left:20px;vertical-align:top;'> |
208 | - <p class='MOTD'>" . \config\Main::APPEARANCE['MOTD'] . "</p> |
|
208 | + <p class='MOTD'>" . \config\Main::APPEARANCE['MOTD']."</p> |
|
209 | 209 | </div><!--header_MOTD-->"; |
210 | 210 | } |
211 | 211 | $retval .= $this->sidebar($advancedControls); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | <html xmlns='http://www.w3.org/1999/xhtml' lang='$ourlocale'> |
232 | 232 | <head lang='$ourlocale'> |
233 | 233 | <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"; |
234 | - $cssUrl = \core\CAT::getRootUrlPath() . "/resources/css/cat.css.php"; |
|
234 | + $cssUrl = \core\CAT::getRootUrlPath()."/resources/css/cat.css.php"; |
|
235 | 235 | $retval .= "<link rel='stylesheet' type='text/css' href='$cssUrl' />"; |
236 | - $retval .= "<title>" . htmlspecialchars($pagetitle) . "</title>"; |
|
236 | + $retval .= "<title>".htmlspecialchars($pagetitle)."</title>"; |
|
237 | 237 | return $retval; |
238 | 238 | } |
239 | 239 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | // we may need to jump up one dir if we are either in admin/ or accountstatus/ |
248 | 248 | // (accountstatus courtesy of my good mood. It's userspace not admin space so |
249 | 249 | // it shouldn't be using this function any more.) |
250 | - $logoBase = \core\CAT::getRootUrlPath() . "/resources/images"; |
|
250 | + $logoBase = \core\CAT::getRootUrlPath()."/resources/images"; |
|
251 | 251 | return "<span id='logos' style='position:fixed; left:50%;'><img src='$logoBase/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
252 | 252 | <img src='$logoBase/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
253 | 253 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | <table style='width:100%'> |
270 | 270 | <tr> |
271 | 271 | <td style='padding-left:20px; padding-right:20px; text-align:left; vertical-align:top;'> |
272 | - " . $cat->catCopyright . "</td>"; |
|
272 | + " . $cat->catCopyright."</td>"; |
|
273 | 273 | if (!empty(\config\Main::APPEARANCE['privacy_notice_url'])) { |
274 | - $retval .= "<td><a href='".\config\Main::APPEARANCE['privacy_notice_url']."'>" . sprintf(_("%s Privacy Notice"),\config\ConfAssistant::CONSORTIUM['display_name']) . "</a></td>"; |
|
274 | + $retval .= "<td><a href='".\config\Main::APPEARANCE['privacy_notice_url']."'>".sprintf(_("%s Privacy Notice"), \config\ConfAssistant::CONSORTIUM['display_name'])."</a></td>"; |
|
275 | 275 | } |
276 | 276 | $retval .= " <td style='padding-left:80px; padding-right:20px; text-align:right; vertical-align:top;'>"; |
277 | 277 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | const DOWNLOAD_REDIRECT_CONTINUE = 1054; |
49 | 49 | const SB_GO_AWAY = 1060; |
50 | 50 | const SB_FRONTPAGE_BIGDOWNLOADBUTTON = 1061; |
51 | -const SB_FRONTPAGE_ROLLER_CUSTOMBUILT= 1062; |
|
51 | +const SB_FRONTPAGE_ROLLER_CUSTOMBUILT = 1062; |
|
52 | 52 | |
53 | 53 | |
54 | 54 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads"); |
88 | 88 | $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), \config\ConfAssistant::CONSORTIUM['display_name']); |
89 | 89 | $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), \config\Main::APPEARANCE['productname']); |
90 | - $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),\config\ConfAssistant::CONSORTIUM['display_name']); |
|
90 | + $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
91 | 91 | $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), \config\ConfAssistant::CONSORTIUM['display_name']); |
92 | 92 | $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = _("Custom built for your organisation"); |
93 | 93 | $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']); |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | ], |
46 | 46 | [ |
47 | 47 | 'title' => sprintf(_("Is it safe to use %s installers?"), \config\Main::APPEARANCE['productname']), |
48 | - 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Main::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Main::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
48 | + 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Main::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Main::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
49 | 49 | ], |
50 | 50 | [ |
51 | 51 | 'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
52 | - 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
52 | + 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | 'title' => sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), \config\ConfAssistant::CONSORTIUM['display_name']), |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $consortium = \config\ConfAssistant::CONSORTIUM['display_name']; |
69 | 69 | array_push($Faq, |
70 | 70 | [ |
71 | - 'id' => 'what_is_' . \config\ConfAssistant::CONSORTIUM['name'], |
|
71 | + 'id' => 'what_is_'.\config\ConfAssistant::CONSORTIUM['name'], |
|
72 | 72 | 'title' => sprintf(_("What is this %s thing anyway?"), $consortium), |
73 | 73 | 'text' => sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than %d hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> or <a href='http://monitor.eduroam.org/map_service_loc.php'>the %s location map</a> for more details."), $consortium, $consortium, $consortium, $SPs, $consortium, $consortium) |
74 | 74 | ]); |
@@ -19,13 +19,13 @@ |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -$out = "<h3>" . _("Access the sources") . "</h3>" . |
|
23 | - sprintf(_("%s is an opensource project. If you are interested in the details of the implementation, please visit <a href='%s'>GitHub</a>."), \config\Main::APPEARANCE['productname'], "https://github.com/GEANT/CAT" ) . |
|
24 | - "<h3>" . _("Join the developers mailing list.") . "</h3>" . |
|
25 | - sprintf(_("The list is available at: %s"), \config\Main::APPEARANCE['support-contact']['display']) . |
|
26 | - "<h3>" . _("Add a translation") . "</h3>" . |
|
27 | - _("If you would like to add a new language to CAT then please contact us ...") . |
|
28 | - "<h3><a href='" . \core\CAT::getRootUrlPath() . "/apidoc' target='_blank'>". _("Documentation") . "</a></h3>" ; |
|
22 | +$out = "<h3>"._("Access the sources")."</h3>". |
|
23 | + sprintf(_("%s is an opensource project. If you are interested in the details of the implementation, please visit <a href='%s'>GitHub</a>."), \config\Main::APPEARANCE['productname'], "https://github.com/GEANT/CAT"). |
|
24 | + "<h3>"._("Join the developers mailing list.")."</h3>". |
|
25 | + sprintf(_("The list is available at: %s"), \config\Main::APPEARANCE['support-contact']['display']). |
|
26 | + "<h3>"._("Add a translation")."</h3>". |
|
27 | + _("If you would like to add a new language to CAT then please contact us ..."). |
|
28 | + "<h3><a href='".\core\CAT::getRootUrlPath()."/apidoc' target='_blank'>"._("Documentation")."</a></h3>"; |
|
29 | 29 | |
30 | 30 | |
31 | 31 |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | \config\ConfAssistant::CONSORTIUM['display_name'], |
43 | 43 | \config\Main::APPEARANCE['productname'], |
44 | 44 | \config\Main::APPEARANCE['productname']); |
45 | -$out .= "<p>" . sprintf(_("<span class='edu_cat'>%s</span> currently supports the following devices and EAP type combinations:"), \config\Main::APPEARANCE['productname']) . "</p>"; |
|
46 | -$out .= "<table><tr><th>" . _("Device Group") . "</th><th>" . _("Device") . "</th>"; |
|
45 | +$out .= "<p>".sprintf(_("<span class='edu_cat'>%s</span> currently supports the following devices and EAP type combinations:"), \config\Main::APPEARANCE['productname'])."</p>"; |
|
46 | +$out .= "<table><tr><th>"._("Device Group")."</th><th>"._("Device")."</th>"; |
|
47 | 47 | foreach (\core\common\EAP::listKnownEAPTypes() as $oneeap) { |
48 | - $out .= "<th style='min-width: 80px;'>" . $oneeap->getPrintableRep() . "</th>"; |
|
48 | + $out .= "<th style='min-width: 80px;'>".$oneeap->getPrintableRep()."</th>"; |
|
49 | 49 | } |
50 | 50 | $out .= "</tr>"; |
51 | 51 | foreach (\devices\Devices::listDevices() as $index => $onedevice) { |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | continue; |
55 | 55 | } |
56 | 56 | } |
57 | - $vendor = (new \web\lib\user\Skinjob())->findResourceUrl("IMAGES", "vendorlogo/" . $onedevice['group'] . ".png"); |
|
57 | + $vendor = (new \web\lib\user\Skinjob())->findResourceUrl("IMAGES", "vendorlogo/".$onedevice['group'].".png"); |
|
58 | 58 | $vendorImg = ""; |
59 | 59 | if ($vendor !== FALSE) { |
60 | 60 | $vendorImg = "<img src='$vendor' alt='logo'>"; |
61 | 61 | } |
62 | - $out .= "<tr><td class='vendor'>$vendorImg</td><td>" . $onedevice['display'] . "</td>"; |
|
62 | + $out .= "<tr><td class='vendor'>$vendorImg</td><td>".$onedevice['display']."</td>"; |
|
63 | 63 | $device_instance = new \core\DeviceFactory($index); |
64 | 64 | foreach (\core\common\EAP::listKnownEAPTypes() as $oneeap) { |
65 | 65 | $out .= "<td>"; |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | |
51 | 51 | array_push($FAQ, [ |
52 | 52 | 'title' => sprintf(_("Is it safe to use %s installers?"), \config\Main::APPEARANCE['productname']), |
53 | - 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Main::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Main::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
53 | + 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Main::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Main::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
54 | 54 | ]); |
55 | 55 | |
56 | 56 | array_push($FAQ, [ |
57 | 57 | 'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
58 | - 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
58 | + 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
59 | 59 | ]); |
60 | 60 | |
61 | 61 | if (\config\Main::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == NULL) { |
62 | 62 | $text = sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your organisation and report the problem, the administrators should be able to trace your connections."), \config\ConfAssistant::CONSORTIUM['display_name']); |
63 | 63 | } else { |
64 | 64 | if (\config\Main::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == 'LOCAL') { |
65 | - $diagUrl = \config\Main::PATHS['cat_base_url'] . "diag/"; |
|
65 | + $diagUrl = \config\Main::PATHS['cat_base_url']."diag/"; |
|
66 | 66 | } else { |
67 | 67 | $diagUrl = \config\Main::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']; |
68 | 68 | } |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | $tocText = ""; |
100 | 100 | $fullText = ""; |
101 | 101 | foreach ($FAQ as $faq) { |
102 | - $tocText .= '<a href="#toc' . $counter . '">' . $faq['title'] . "</a><br>\n"; |
|
103 | - $fullText .= "<dt><a name=toc$counter>" . $faq['title'] . "</a></dt>\n<dd>" . $faq['text'] . "</dd>\n"; |
|
102 | + $tocText .= '<a href="#toc'.$counter.'">'.$faq['title']."</a><br>\n"; |
|
103 | + $fullText .= "<dt><a name=toc$counter>".$faq['title']."</a></dt>\n<dd>".$faq['text']."</dd>\n"; |
|
104 | 104 | $counter++; |
105 | 105 | } |
106 | 106 | ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
108 | 108 | ob_start(); |
109 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
109 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
110 | 110 | $source = $this->findSourceFile($source_name); |
111 | 111 | |
112 | 112 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | $output = ob_get_clean(); |
116 | 116 | if ($encoding != "NONE") { |
117 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
117 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
118 | 118 | if ($outputClean) { |
119 | 119 | $output = $outputClean; |
120 | 120 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $encoding = "NONE"; |
159 | 159 | } |
160 | 160 | if ($encoding != "NONE") { |
161 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
161 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
162 | 162 | } else { |
163 | 163 | $output_c = $source_string; |
164 | 164 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | if (isset(WindowsCommon::LANGS[$this->languageInstance->getLang()])) { |
236 | 236 | $language = WindowsCommon::LANGS[$this->languageInstance->getLang()]; |
237 | 237 | $this->lang = $language['nsis']; |
238 | - $this->codePage = 'cp' . $language['cp']; |
|
238 | + $this->codePage = 'cp'.$language['cp']; |
|
239 | 239 | } else { |
240 | 240 | $this->lang = 'English'; |
241 | 241 | $this->codePage = 'cp1252'; |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']); |
258 | 258 | $out .= "<p>"; |
259 | 259 | if ($ssidCount > $configCount) { |
260 | - $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " "; |
|
261 | - $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
260 | + $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." "; |
|
261 | + $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
262 | 262 | $out .= "<p>"; |
263 | 263 | } |
264 | 264 | // TODO - change this below |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range."); |
275 | 275 | if ($ssidCount > 1) { |
276 | 276 | $out .= "<p>"; |
277 | - $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
278 | - $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
277 | + $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
278 | + $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | return $out; |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | */ |
381 | 381 | protected function signInstaller() |
382 | 382 | { |
383 | - $fileName = $this->installerBasename . '.exe'; |
|
383 | + $fileName = $this->installerBasename.'.exe'; |
|
384 | 384 | if (!$this->sign) { |
385 | 385 | rename("installer.exe", $fileName); |
386 | 386 | return $fileName; |
387 | 387 | } |
388 | 388 | // are actually signing |
389 | - $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
389 | + $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
390 | 390 | if ($outputFromSigning === FALSE) { |
391 | 391 | $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
392 | 392 | } |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | */ |
401 | 401 | protected function compileNSIS() { |
402 | 402 | if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
403 | - $makensis = \config\ConfAssistant::PATHS['makensis'] . " -INPUTCHARSET UTF8"; |
|
403 | + $makensis = \config\ConfAssistant::PATHS['makensis']." -INPUTCHARSET UTF8"; |
|
404 | 404 | } else { |
405 | 405 | $makensis = \config\ConfAssistant::PATHS['makensis']; |
406 | 406 | } |
407 | 407 | $lcAll = getenv("LC_ALL"); |
408 | 408 | putenv("LC_ALL=en_US.UTF-8"); |
409 | - $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1'; |
|
409 | + $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1'; |
|
410 | 410 | system($command); |
411 | - putenv("LC_ALL=" . $lcAll); |
|
411 | + putenv("LC_ALL=".$lcAll); |
|
412 | 412 | $this->loggerInstance->debug(4, "compileNSIS:$command\n"); |
413 | 413 | } |
414 | 414 | |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | 'email' => 'SUPPORT', |
426 | 426 | 'url' => 'URL', |
427 | 427 | ]; |
428 | - $s = "support_" . $type . "_substitute"; |
|
428 | + $s = "support_".$type."_substitute"; |
|
429 | 429 | $substitute = $this->translateString($this->$s, $this->codePage); |
430 | - $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute; |
|
431 | - return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n"; |
|
430 | + $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute; |
|
431 | + return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n"; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | * @return string |
439 | 439 | */ |
440 | 440 | protected function writeNsisDefines($attr) { |
441 | - $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION; |
|
441 | + $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION; |
|
442 | 442 | if ($attr['internal:profile_count'][0] > 1) { |
443 | - $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
443 | + $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
444 | 444 | '; |
445 | 445 | } |
446 | - $fcontents .= ' |
|
447 | -Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
448 | -!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449 | -!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
446 | + $fcontents .= ' |
|
447 | +Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
448 | +!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
449 | +!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
450 | 450 | !define INSTALLER_NAME "installer.exe" |
451 | -!define LANG "' . $this->lang . '" |
|
452 | -!define LOCALE "' . preg_replace('/\..*$/', '', \config\Main::LANGUAGES[$this->languageInstance->getLang()]['locale']) . '" |
|
451 | +!define LANG "' . $this->lang.'" |
|
452 | +!define LOCALE "' . preg_replace('/\..*$/', '', \config\Main::LANGUAGES[$this->languageInstance->getLang()]['locale']).'" |
|
453 | 453 | ;-------------------------------- |
454 | -!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
454 | +!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
455 | 455 | '; |
456 | 456 | $fcontents .= $this->getSupport($attr, 'email'); |
457 | 457 | $fcontents .= $this->getSupport($attr, 'url'); |
@@ -459,18 +459,18 @@ discard block |
||
459 | 459 | $fcontents .= '!define WIRED |
460 | 460 | '; |
461 | 461 | } |
462 | - $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
462 | + $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
463 | 463 | '; |
464 | 464 | if (!empty($attr['internal:realm'][0])) { |
465 | - $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
465 | + $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
466 | 466 | '; |
467 | 467 | } |
468 | 468 | if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
469 | - $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
469 | + $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
470 | 470 | '; |
471 | 471 | } |
472 | 472 | if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
473 | - $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
473 | + $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
474 | 474 | '; |
475 | 475 | } |
476 | 476 | $fcontents .= $this->msInfoFile($attr); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $out .= '!define EXTERNAL_INFO "'; |
492 | 492 | // $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
493 | 493 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
494 | - $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
494 | + $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
495 | 495 | } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
496 | 496 | $infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
497 | 497 | if ($infoFile === FALSE) { |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
501 | 501 | $infoFileConverted = $infoFile; |
502 | 502 | } else { |
503 | - $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
503 | + $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
504 | 504 | } |
505 | 505 | if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
506 | 506 | file_put_contents('info_f.txt', $infoFileConverted); |
507 | 507 | $out = '!define LICENSE_FILE " info_f.txt'; |
508 | 508 | } |
509 | 509 | } else { |
510 | - $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
510 | + $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $out .= "\"\n"; |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | class CertificationAuthorityEduPki extends EntityWithDBProperties implements CertificationAuthorityInterface |
18 | 18 | { |
19 | 19 | |
20 | - private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | - private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | - private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
20 | + private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
21 | + private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
22 | + private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
23 | 23 | private const EDUPKI_RA_ID = 700; |
24 | 24 | private const EDUPKI_CERT_PROFILE = "User SOAP"; |
25 | 25 | private const EDUPKI_RA_PKEY_PASSPHRASE = "..."; |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | parent::__construct(); |
36 | 36 | |
37 | 37 | if (stat(CertificationAuthorityEduPki::LOCATION_RA_CERT) === FALSE) { |
38 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPki::LOCATION_RA_CERT); |
|
38 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPki::LOCATION_RA_CERT); |
|
39 | 39 | } |
40 | 40 | if (stat(CertificationAuthorityEduPki::LOCATION_RA_KEY) === FALSE) { |
41 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPki::LOCATION_RA_KEY); |
|
41 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPki::LOCATION_RA_KEY); |
|
42 | 42 | } |
43 | 43 | if (stat(CertificationAuthorityEduPki::LOCATION_WEBROOT) === FALSE) { |
44 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPki::LOCATION_WEBROOT); |
|
44 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPki::LOCATION_WEBROOT); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | // initialise connection to eduPKI CA / eduroam RA and send the request to them |
73 | 73 | try { |
74 | 74 | $altArray = [# Array mit den Subject Alternative Names |
75 | - "email:" . $csr["USERNAME"] |
|
75 | + "email:".$csr["USERNAME"] |
|
76 | 76 | ]; |
77 | 77 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
78 | 78 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
79 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPki::EDUPKI_RA_ID . "\n"); |
|
80 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n"); |
|
79 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPki::EDUPKI_RA_ID."\n"); |
|
80 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n"); |
|
81 | 81 | $this->loggerInstance->debug(5, "PARAM_3: "); |
82 | 82 | $this->loggerInstance->debug(5, $altArray); |
83 | - $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE . "\n"); |
|
84 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
85 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
86 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERNAME"] . "\n"); |
|
87 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
83 | + $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE."\n"); |
|
84 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
85 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
86 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERNAME"]."\n"); |
|
87 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
88 | 88 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
89 | 89 | $soapNewRequest = $soapPub->newRequest( |
90 | 90 | CertificationAuthorityEduPki::EDUPKI_RA_ID, # RA-ID |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | } catch (Exception $e) { |
107 | 107 | // PHP 7.1 can do this much better |
108 | 108 | if (is_soap_fault($e)) { |
109 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
109 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
110 | 110 | $e->faultstring |
111 | 111 | }\n"); |
112 | 112 | } |
113 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
113 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
114 | 114 | } |
115 | 115 | try { |
116 | 116 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | $soapReqnum, [ |
123 | 123 | "RaID" => CertificationAuthorityEduPki::EDUPKI_RA_ID, |
124 | 124 | "Role" => CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE, |
125 | - "Subject" => "DC=eduroam,DC=test,DC=test,C=" . $csr["FED"] . ",O=" . \config\ConfAssistant::CONSORTIUM['name'] . ",OU=" . $csr["FED"] . ",CN=" . $csr['USERNAME'] . ",emailAddress=" . $csr['USERNAME'], |
|
126 | - "SubjectAltNames" => ["email:" . $csr["USERNAME"]], |
|
125 | + "Subject" => "DC=eduroam,DC=test,DC=test,C=".$csr["FED"].",O=".\config\ConfAssistant::CONSORTIUM['name'].",OU=".$csr["FED"].",CN=".$csr['USERNAME'].",emailAddress=".$csr['USERNAME'], |
|
126 | + "SubjectAltNames" => ["email:".$csr["USERNAME"]], |
|
127 | 127 | "NotBefore" => (new \DateTime())->format('c'), |
128 | 128 | "NotAfter" => $expiry->format('c'), |
129 | 129 | ] |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
143 | 143 | // rather than just using the string. Grr. |
144 | 144 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
145 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
145 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
146 | 146 | // retrieve our RA cert from filesystem |
147 | 147 | // the RA certificates are not needed right now because we |
148 | 148 | // have resorted to S/MIME signatures with openssl command-line |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
155 | 155 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
156 | 156 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
157 | - $execCmd = \config\Main::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
157 | + $execCmd = \config\Main::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
158 | 158 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
159 | 159 | $output = []; |
160 | 160 | $return = 999; |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | throw new Exception("Non-zero return value from openssl smime!"); |
164 | 164 | } |
165 | 165 | // and get the signature blob back from the filesystem |
166 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
166 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
167 | 167 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
168 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
169 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
170 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
168 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
169 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
170 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
171 | 171 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
172 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
173 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
172 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
173 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
174 | 174 | if ($soapIssueCert === FALSE) { |
175 | 175 | throw new Exception("The locally approved request was NOT processed by the CA."); |
176 | 176 | } |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | throw new Exception("CAInfo has no root certificate for us!"); |
208 | 208 | } |
209 | 209 | } catch (SoapFault $e) { |
210 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
210 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
211 | 211 | } catch (Exception $e) { |
212 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
212 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
213 | 213 | } |
214 | 214 | return [ |
215 | 215 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
243 | 243 | // rather than just using the string. Grr. |
244 | 244 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
245 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
245 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
246 | 246 | // retrieve our RA cert from filesystem |
247 | 247 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
248 | 248 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
249 | 249 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
250 | - $execCmd = \config\Main::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPki::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPki::LOCATION_RA_CERT; |
|
250 | + $execCmd = \config\Main::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPki::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPki::LOCATION_RA_CERT; |
|
251 | 251 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
252 | 252 | $output = []; |
253 | 253 | $return = 999; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | throw new Exception("Non-zero return value from openssl smime!"); |
257 | 257 | } |
258 | 258 | // and get the signature blob back from the filesystem |
259 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
259 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
260 | 260 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
261 | 261 | if ($soapIssueRev === FALSE) { |
262 | 262 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | } catch (Exception $e) { |
265 | 265 | // PHP 7.1 can do this much better |
266 | 266 | if (is_soap_fault($e)) { |
267 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
267 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
268 | 268 | } |
269 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
269 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -366,9 +366,9 @@ discard block |
||
366 | 366 | */ |
367 | 367 | public function soapToXmlInteger($x) |
368 | 368 | { |
369 | - return '<' . $x[0] . '>' |
|
369 | + return '<'.$x[0].'>' |
|
370 | 370 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
371 | - . '</' . $x[0] . '>'; |
|
371 | + . '</'.$x[0].'>'; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -387,9 +387,9 @@ discard block |
||
387 | 387 | // dump private key into directory |
388 | 388 | $outstring = ""; |
389 | 389 | openssl_pkey_export($privateKey, $outstring); |
390 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
390 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
391 | 391 | // PHP can only do one DC in the Subject. But we need three. |
392 | - $execCmd = \config\Main::PATHS['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username"; |
|
392 | + $execCmd = \config\Main::PATHS['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username"; |
|
393 | 393 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
394 | 394 | $output = []; |
395 | 395 | $return = 999; |
@@ -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\Main::PATHS['openssl'] . " crl -inform der"; |
|
383 | + $proc = \config\Main::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\Main::APPEARANCE['productname'] . ' testing" |
|
550 | + ssid="' . \config\Main::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\Main::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
767 | - $this->loggerInstance->debug(4, \config\Main::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\Main::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
770 | - $this->loggerInstance->debug(4, \config\Main::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\Main::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly); |
|
767 | + $this->loggerInstance->debug(4, \config\Main::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\Main::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts); |
|
770 | + $this->loggerInstance->debug(4, \config\Main::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 | ]; |