Fixed server crash in AMT manager.
Ylian Saint-Hilaire committed
Oct 28, 2020 at 14:46 UTC
dd63851403bcf3bf9d37314d40cd462f6d3c363b
23 files changed
+43
-7
amt/amt-wsman-comm.js
+1
-1
@@ -229,7 +229,7 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
229
230
// let's chain up the TLSSocket <-> SerialTunnel <-> CIRA APF (chnl)
231
// Anything that needs to be forwarded by SerialTunnel will be encapsulated by chnl write
232
- ser.forwardwrite = function (msg) { obj.cirasocket.write(msg); }; // TLS ---> CIRA
232
+ ser.forwardwrite = function (msg) { try { obj.cirasocket.write(msg); } catch (ex) { } }; // TLS ---> CIRA
233
234
// When APF tunnel return something, update SerialTunnel buffer
235
obj.cirasocket.onData = function (ciraconn, data) { if (data.length > 0) { try { ser.updateBuffer(Buffer.from(data, 'binary')); } catch (e) { } } }; // CIRA ---> TLS
amtmanager.js
+3
-1
@@ -877,7 +877,9 @@ module.exports.CreateAmtManager = function (parent) {
877
const dev = stack.dev;
878
if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.
879
if (status != 200) { dev.consoleMsg("Failed to add TLS certificate (" + status + ")."); removeAmtDevice(dev); return; }
880
- var certInstanceId = responses.Body['CreatedCertificate']['ReferenceParameters']['SelectorSet']['Selector']['Value'];
880
+ var certInstanceId = null;
881
+ try { certInstanceId = responses.Body['CreatedCertificate']['ReferenceParameters']['SelectorSet']['Selector']['Value']; } catch (ex) { }
882
+ if (certInstanceId == null) { dev.consoleMsg("Failed to get TLS certificate identifier."); removeAmtDevice(dev); return; }
883
884
// Set the TLS certificate
885
dev.setTlsSecurityPendingCalls = 3;
views/agentinvite.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/default-mobile.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link rel="manifest" href="{{{domainurl}}}manifest.json">
11
<link rel="shortcut icon" href="{{{domainurl}}}favicon.ico" />
12
<link rel="icon" type="image/png" sizes="16x16" href="{{{domainurl}}}favicon-16x16.png">
views/default.handlebars
+19
-5
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type="image/x-icon" href="{{{domainurl}}}favicon.ico" rel="shortcut icon" />
11
<link keeplink=1 type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
12
<link type="text/css" href="styles/ol.css" media="screen" rel="stylesheet" title="CSS" />
@@ -2334,6 +2335,18 @@
2335
var rdpurl = 'http://' + window.location.hostname + ':' + basicPort + domainUrl + 'clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F' + window.location.hostname + '%2Fmeshrelay.ashx%3Fauth=' + message.cookie + '&CH={{{webcerthash}}}&AP=' + message.protocol + ((debugmode == 1) ? '' : '&HOL=1');
2336
safeNewWindow(rdpurl, '_blank');
2337
}
2338
+ /*
2339
+ var servername = serverinfo.name;
2340
+ if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name.
2341
+ var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
2342
+ var portStr = (serverinfo.port == 443) ? '' : (':' + serverinfo.port);
2343
+ var url = 'mcrouter://' + servername + portStr + domainUrl + 'control.ashx?c=' + authCookie + '&t=' + serverinfo.tlshash + '&l={{{lang}}}' + (urlargs.key?('&key=' + urlargs.key):'');
2344
+ if (message.nodeid != null) { url += ('&n=' + message.nodeid); }
2345
+ if (message.protocol != null) { url += ('&p=' + message.protocol); }
2346
+ if (message.tcpport != null) { url += ('&tcpport=' + message.tcpport); }
2347
+ console.log(url);
2348
+ downloadFile(url, '');
2349
+ */
2350
} else if (message.tag == 'novnc') {
2351
var vncurl = window.location.origin + domainUrl + 'novnc/vnc.html?ws=wss%3A%2F%2F' + window.location.host + encodeURIComponentEx(domainUrl) + 'meshrelay.ashx%3Fauth%3D' + message.cookie + '&show_dot=1' + (urlargs.key?('&key=' + urlargs.key):'') + '&l={{{lang}}}';
2352
var node = getNodeFromId(message.nodeid);
@@ -3996,9 +4009,9 @@
4009
r += ' <a href=# style=cursor:pointer;font-size:small title="' + "Add a new computer to this device group by installing the mesh agent." + '" onclick=\'return addAgentToMesh("' + mesh._id + '")\'>' + "Add Agent" + '</a>';
4010
if ((features & 2) == 0) { r += ' <a href=# style=cursor:pointer;font-size:small title="' + "Invite someone to install the mesh agent on this device group." + '" onclick=\'return inviteAgentToMesh("' + mesh._id + '")\'>' + "Invite" + '</a>'; }
4011
}
3999
- if (mesh.amt && (mesh.amt.type > 2)) { // ACM activation or Full Automatic
4000
- r += ' <a href=# style=cursor:pointer;font-size:small title="' + "Switch Intel AMT to Admin Control Mode (ACM)." + '" onclick=\'return showAmtAcmSetup()\'>' + "ACM" + '</a>';
4001
- }
4012
+ //if (mesh.amt && (mesh.amt.type > 2)) { // ACM activation or Full Automatic
4013
+ // r += ' <a href=# style=cursor:pointer;font-size:small title="' + "Switch Intel AMT to Admin Control Mode (ACM)." + '" onclick=\'return showAmtAcmSetup()\'>' + "ACM" + '</a>';
4014
+ //}
4015
return r;
4016
}
4017
@@ -6522,7 +6535,7 @@
6535
if (os == 16) { osn = "MeshCmd (macOS, 64bit)"; }
6536
if (os == 25) { osn = "MeshCmd (Linux ARM, 32bit)"; }
6537
QH('meshcmddownloadid', osn);
6525
- Q('meshcmddownloadid').onclick = function() { downloadFile('meshagents?meshcmd=' + os + (urlargs.key?('&key=' + urlargs.key):''), null, true); }
6538
+ Q('meshcmddownloadid').onclick = function() { downloadFile('meshagents?meshcmd=' + os + (urlargs.key?('&key=' + urlargs.key):'')); }
6539
}
6540
6541
function p10showiconselector() {
@@ -13713,7 +13726,8 @@
13726
var element = document.createElement('a');
13727
element.setAttribute('href', link);
13728
element.setAttribute('rel', 'noreferrer noopener');
13716
- if (navigator.userAgent.indexOf('Firefox') >= 0) { element.setAttribute('download', decodeURIComponent(name?name:'')); } else { element.setAttribute('target', 'fileDownloadFrame'); }
13729
+ element.setAttribute('target', 'fileDownloadFrame');
13730
+ if (navigator.userAgent.indexOf('Firefox') >= 0) { element.setAttribute('download', decodeURIComponent(name?name:'')); }
13731
document.body.appendChild(element);
13732
element.click();
13733
document.body.removeChild(element);
views/desktop.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/download.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name=viewport content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name=apple-mobile-web-app-capable content=yes />
8
<meta name=format-detection content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type=text/css href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<title>{{{title1}}} - Download</title>
views/download2.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name=viewport content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name=apple-mobile-web-app-capable content=yes />
8
<meta name=format-detection content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type=text/css href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<title>{{{title1}}} - Download</title>
views/error404-mobile.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
11
<title>{{{title}}}</title>
12
<style type="text/css">
views/error404.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link type="text/css" href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<title>{{{title}}}</title>
views/error4042.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name=viewport content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name=apple-mobile-web-app-capable content=yes />
8
<meta name=format-detection content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type=text/css href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<title>{{{title1}}} - Download</title>
views/invite.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/login-mobile.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link rel="manifest" href="{{{domainurl}}}manifest.json">
11
<link rel="shortcut icon" href="{{{domainurl}}}favicon.ico" />
12
<link rel="icon" type="image/png" sizes="16x16" href="{{{domainurl}}}favicon-16x16.png">
views/login.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link rel="shortcut icon" type="image/x-icon" href="{{{domainurl}}}favicon.ico" />
11
<link keeplink=1 type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
12
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
views/login2.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link rel="shortcut icon" type="image/x-icon" href="{{{domainurl}}}favicon.ico" />
11
<link keeplink=1 type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
12
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
views/message.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name=viewport content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name=apple-mobile-web-app-capable content=yes />
8
<meta name=format-detection content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type=text/css href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/message2.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name=viewport content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name=apple-mobile-web-app-capable content=yes />
8
<meta name=format-detection content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type=text/css href="/styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/messenger.handlebars
+1
@@ -5,6 +5,7 @@
5
<meta http-equiv=X-UA-Compatible content="IE=edge">
6
<meta content="text/html;charset=utf-8" http-equiv=Content-Type>
7
<meta name=format-detection content="telephone=no">
8
+ <meta name="robots" content="noindex,nofollow">
9
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
10
<link type="text/css" href="styles/messenger.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
views/mstsc.handlebars
+1
@@ -4,6 +4,7 @@
4
<meta charset="utf-8">
5
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6
<meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <meta name="robots" content="noindex,nofollow">
8
<link rel="icon" href="/favicon.ico">
9
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
10
<title>RDP</title>
views/player.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/terms-mobile.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
11
<title>{{{title}}} - Terms of use</title>
12
<style type="text/css">
views/terms.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow" />
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
12
<script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
views/xterm.handlebars
+1
@@ -6,6 +6,7 @@
6
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
<meta name="apple-mobile-web-app-capable" content="yes" />
8
<meta name="format-detection" content="telephone=no" />
9
+ <meta name="robots" content="noindex,nofollow">
10
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
<link type="text/css" href="styles/xterm.css" media="screen" rel="stylesheet" title="CSS" />
12
<link rel="apple-touch-icon" href="/favicon-303x303.png" />