AMT Manager defaults to TLS on all connection types.

Ylian Saint-Hilaire committed Oct 22, 2020 at 21:46 UTC 964857d57484b8a1ebd8161311683a01110c9f32
6 files changed +9 -8
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/modules_meshcmd/apfclient.js
+2 -1
@@ -324,7 +324,8 @@ function CreateAPFClient(parent, args) {
324 });
325
326 chan.on('error', function (e) {
327 - Debug("Downlink connection error: " + e);
327 + //Debug("Downlink connection error: " + e);
328 + SendChannelOpenFailure(socket.ws, p_res);
329 });
330
331 chan.on('end', function () {
agents/modules_meshcore/apfclient.js
+2 -1
@@ -324,7 +324,8 @@ function CreateAPFClient(parent, args) {
324 });
325
326 chan.on('error', function (e) {
327 - Debug("Downlink connection error: " + e);
327 + //Debug("Downlink connection error: " + e);
328 + SendChannelOpenFailure(socket.ws, p_res);
329 });
330
331 chan.on('end', function () {
amt/amt-wsman-comm.js
+1 -1
@@ -426,7 +426,7 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
426 if (obj.mpsConnection == null) { obj.socket.end(); } else { obj.socket.close(); }
427 } else {
428 var r = obj.pendingAjaxCall.shift();
429 - if (r == null || r.length < 1) { console.log("pendingAjaxCall error, " + r); return; }
429 + if ((r == null) || (r.length < 1)) { /*console.log("pendingAjaxCall error, " + r);*/ return; } // Get a response without any pending requests.
430 //if (s != 200) { obj.Debug("Error, status=" + s + "\r\n\r\nreq=" + r[0] + "\r\n\r\nresp=" + data); } // Debug: Display the request & response if something did not work.
431 obj.authcounter = 0;
432 obj.ActiveAjaxCount--;
amtmanager.js
+4 -5
@@ -418,8 +418,8 @@ module.exports.CreateAmtManager = function (parent) {
418 dev.amtstack.dev = dev;
419 dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse);
420 break;
421 - case 1:
422 - case 2:
421 + case 1: // CIRA-Relay
422 + case 2: // CIRA-LMS
423 // Handle the case where the Intel AMT relay or LMS is connected (connType 1 or 2)
424 // Check to see if CIRA is connected on this server.
425 var ciraconn = dev.mpsConnection;
@@ -433,7 +433,6 @@ module.exports.CreateAmtManager = function (parent) {
433
434 // Connect now
435 var comm;
436 - dev.tlsfail = true; // DEBUG!!!!!!!
436 if (dev.tlsfail !== true) {
437 parent.debug('amt', 'Relay-Connect', "TLS", dev.name, user, pass);
438 comm = CreateWsmanComm(dev.nodeid, 16993, user, pass, 1, null, ciraconn); // Perform TLS
@@ -447,7 +446,7 @@ module.exports.CreateAmtManager = function (parent) {
446 dev.amtstack.dev = dev;
447 dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse);
448 break;
450 - case 3:
449 + case 3: // Local LAN
450 // Handle the case where the Intel AMT local scanner found the device (connType 3)
451 parent.debug('amt', "Attempt Initial Local Contact", dev.name, dev.connType, dev.host);
452 if (typeof dev.host != 'string') { removeAmtDevice(dev); return; } // Local connection not valid
@@ -555,7 +554,7 @@ module.exports.CreateAmtManager = function (parent) {
554 });
555 } else {
556 // We got a bad response
558 - if ((dev.conntype == 1) && (dev.tlsfail !== true) && (status == 408)) {
557 + if ((dev.conntype != 0) && (dev.tlsfail !== true) && (status == 408)) { // If not using CIRA and we get a 408 error while using TLS, try non-TLS.
558 // TLS error on a local connection, try again without TLS
559 dev.tlsfail = true; attemptInitialContact(dev); return;
560 } else if (status == 401) {