More AMT 802.1x support improvements.

Ylian Saint-Hilaire committed Apr 4, 2022 at 17:51 UTC 9e67ab373aa4c1b0cab14b3fd153902a1739e7a3
1 file changed +10 -1
amtmanager.js
+10 -1
@@ -208,6 +208,13 @@ module.exports.CreateAmtManager = function (parent) {
208
209 // Remove all Intel AMT management sessions for this nodeid
210 delete obj.amtDevices[nodeid];
211 +
212 + // If a 802.1x profile is active with MeshCentral Satellite, notify Satellite of the removal
213 + if (domain.amtmanager['802.1x'] != null) {
214 + var reqId = Buffer.from(parent.crypto.randomBytes(16), 'binary').toString('base64'); // Generate a crypto-secure request id.
215 + parent.DispatchEvent([domain.amtmanager['802.1x'].satellitecredentials], obj, { action: 'satellite', satelliteFlags: 2, nodeid: nodeid, icon: 0, domain: nodeid.split('/')[1], nolog: 1, reqid: reqId, authProtocol: -1 });
216 + }
217 +
218 return true;
219 }
220
@@ -356,6 +363,7 @@ module.exports.CreateAmtManager = function (parent) {
363 for (var i in devices) {
364 var dev = devices[i];
365 dev.name = event.node.name;
366 + dev.icon = event.node.icon;
367
368 // If there are any changes, apply them.
369 if (event.node.intelamt != null) {
@@ -456,6 +464,7 @@ module.exports.CreateAmtManager = function (parent) {
464
465 // Setup the monitored device
466 dev.name = node.name;
467 + dev.icon = node.icon;
468 dev.meshid = node.meshid;
469 dev.intelamt = node.intelamt;
470
@@ -1452,7 +1461,7 @@ module.exports.CreateAmtManager = function (parent) {
1461 dev.consoleMsg("Requesting 802.1x credentials for " + netAuthStrings[srvNetAuthProfile.authenticationprotocol] + " from MeshCentral Satellite...");
1462 dev.netAuthSatReqId = Buffer.from(parent.crypto.randomBytes(16), 'binary').toString('base64'); // Generate a crypto-secure request id.
1463 dev.netAuthSatReqData = { domain: domain, wiredConfig: wiredConfig, wirelessConfig: wirelessConfig, devNetAuthProfile: devNetAuthProfile, srvNetAuthProfile: srvNetAuthProfile, profilesToAdd: profilesToAdd, prioritiesInUse: prioritiesInUse, responses: responses }
1455 - parent.DispatchEvent([srvNetAuthProfile.satellitecredentials], obj, { action: 'satellite', satelliteFlags: 2, nodeid: dev.nodeid, domain: dev.nodeid.split('/')[1], nolog: 1, reqid: dev.netAuthSatReqId, authProtocol: srvNetAuthProfile.authenticationprotocol, devname: dev.name });
1464 + parent.DispatchEvent([srvNetAuthProfile.satellitecredentials], obj, { action: 'satellite', satelliteFlags: 2, nodeid: dev.nodeid, icon: dev.icon, domain: dev.nodeid.split('/')[1], nolog: 1, reqid: dev.netAuthSatReqId, authProtocol: srvNetAuthProfile.authenticationprotocol, devname: dev.name });
1465
1466 // Set a response timeout
1467 const netAuthTimeoutFunc = function netAuthTimeout() {