Added MEI state exchange over CIRA-LMS.

Ylian Saint-Hilaire committed Oct 19, 2020 at 22:23 UTC 8b61f1d64c8ab1ad7f42df3bafdfceb3f370cfd8
11 files changed +158 -95
MeshCentralServer.njsproj
+1
@@ -35,6 +35,7 @@
35 <Compile Include="agents\modules_meshcmd\amt-wsman.js" />
36 <Compile Include="agents\modules_meshcmd\amt-xml.js" />
37 <Compile Include="agents\modules_meshcmd\amt.js" />
38 + <Compile Include="agents\modules_meshcmd\apfclient.js" />
39 <Compile Include="agents\modules_meshcmd\identifiers.js" />
40 <Compile Include="agents\modules_meshcmd\smbios.js" />
41 <Compile Include="agents\modules_meshcmd\sysinfo.js" />
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/MeshService-signed.exe
Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ
agents/MeshService64-signed.exe
Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ
agents/meshcmd.js
+68 -72
@@ -597,20 +597,7 @@ function run(argv) {
597 });
598 } else if (settings.action == 'amtinfodebug') {
599 // Display Intel AMT version and activation state
600 - mestate = {};
601 - var amtMeiModule, amtMei;
602 - try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; }
603 - amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; });
604 - amtMei.getVersion(function (result) { console.log('getVersion: ' + JSON.stringify(result)); });
605 - amtMei.getProvisioningState(function (result) { console.log('getProvisioningState: ' + JSON.stringify(result)); });
606 - amtMei.getProvisioningMode(function (result) { console.log('getProvisioningMode: ' + JSON.stringify(result)); });
607 - amtMei.getEHBCState(function (result) { if (result) { console.log('getEHBCState: ' + JSON.stringify(result)); } });
608 - amtMei.getControlMode(function (result) { if (result) { console.log('getControlMode: ' + JSON.stringify(result)); } });
609 - amtMei.getMACAddresses(function (result) { if (result) { console.log('getMACAddresses: ' + JSON.stringify(result)); } });
610 - amtMei.getLanInterfaceSettings(0, function (result) { console.log('getLanInterfaceSettings0: ' + JSON.stringify(result)); });
611 - amtMei.getLanInterfaceSettings(1, function (result) { console.log('getLanInterfaceSettings1: ' + JSON.stringify(result)); });
612 - amtMei.getUuid(function (result) { console.log('getUuid: ' + JSON.stringify(result)); });
613 - amtMei.getDnsSuffix(function (result) { console.log('getDnsSuffix: ' + JSON.stringify(result)); exit(1); });
600 + getMeiState(15, function (state) { console.log(JSON.stringify(state, null, 2)); exit(1); }); // Flags: 1 = Versions, 2 = OsAdmin, 4 = Hashes, 8 = Network
601 } else if (settings.action == 'amtsavestate') {
602 // Save the entire state of Intel AMT info a JSON file
603 if ((settings.password == null) || (typeof settings.password != 'string') || (settings.password == '')) { console.log('No or invalid \"password\" specified, use --password [password].'); exit(1); return; }
@@ -1148,75 +1135,50 @@ function startMeshCommander() {
1135 function configureAmt() {
1136 console.log('Starting Intel AMT configuration...');
1137 settings.noconsole = true;
1151 -
1152 - // Display Intel AMT version and activation state
1153 - mestate = {};
1154 - var amtMeiModule, amtMei;
1155 - try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; }
1156 - amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; });
1157 - amtMei.getProvisioningState(function (result) { if (result) { mestate.ProvisioningState = result; } });
1158 - amtMei.getVersion(function (val) { mestate.vers = {}; if (val != null) { for (var version in val.Versions) { mestate.vers[val.Versions[version].Description] = val.Versions[version].Version; } } });
1159 - amtMei.getLanInterfaceSettings(0, function (result) { if (result) { mestate.net0 = result; } });
1160 - amtMei.getUuid(function (result) { if ((result != null) && (result.uuid != null)) { mestate.uuid = result.uuid; } });
1161 - amtMei.getControlMode(function (result) { if (result != null) { mestate.controlMode = result.controlMode; } }); // controlMode: 0 = NoActivated, 1 = CCM, 2 = ACM
1162 - amtMei.getDnsSuffix(function (result) {
1163 - if ((mestate.vers == null) || (mestate.vers['AMT'] == null)) { console.log("Unable to get Intel AMT version."); exit(100); return; }
1164 - if (mestate.ProvisioningState == null) { console.log("Unable to read Intel AMT activation state."); exit(100); return; }
1165 - //if ((settings.action != 'amtdiscover') && (mestate.controlMode == 2)) { console.log("Intel AMT already activation in admin control mode."); exit(100); return; }
1166 - if (mestate.uuid == null) { console.log("Unable to get Intel AMT UUID."); exit(100); return; }
1167 - var fqdn = null;
1168 - //if ((mestate.net0 == null) && (meinfo.net0.enabled != 0)) { console.log("No Intel AMT wired interface, can't perform ACM activation."); exit(100); return; }
1169 - if (result) { fqdn = result; } // If Intel AMT has a trusted DNS suffix set, use that one.
1170 - else {
1171 - // Look for the DNS suffix for the Intel AMT Ethernet interface
1172 - var interfaces = require('os').networkInterfaces();
1173 - for (var i in interfaces) {
1174 - for (var j in interfaces[i]) {
1175 - if ((interfaces[i][j].mac == mestate.net0.mac) && (interfaces[i][j].fqdn != null) && (interfaces[i][j].fqdn != '')) { fqdn = interfaces[i][j].fqdn; }
1176 - }
1177 - }
1178 - }
1179 - if (fqdn != null) { settings.fqdn = fqdn; settings.uuid = mestate.uuid; }
1180 - getTrustedHashes(amtMei, function () { startLms(configureAmt2, amtMei); });
1181 - });
1182 -
1138 + startLms(configureAmt2, amtMei);
1139 }
1140
1141 function configureAmt2() {
1186 - // Connect to MPS and start APF relay
1187 - var apfarg = {
1188 - mpsurl: settings.url,
1189 - mpsuser: settings.id.substring(0, 16),
1190 - mpspass: settings.id.substring(0, 16),
1191 - mpskeepalive: 60000,
1192 - clientname: require('os').hostname(),
1193 - clientaddress: '127.0.0.1',
1194 - clientuuid: mestate.uuid,
1195 - conntype: 2 // 0 = CIRA, 1 = Relay, 2 = LMS. The correct value is 2 since we are performing an LMS relay.
1196 - };
1197 - if ((apfarg.clientuuid == null) || (apfarg.clientuuid.length != 36)) {
1198 - console.log("Unable to get Intel AMT UUID: " + apfarg.clientuuid);
1199 - exit(1); return;
1200 - } else {
1201 - settings.apftunnel = require('apfclient')({ debug: (settings.debuglevel > 0) }, apfarg);
1202 - settings.apftunnel.onJsonControl = configureJsonControl;
1203 - settings.apftunnel.onChannelClosed = function () { exit(0); }
1204 - try {
1205 - settings.apftunnel.connect();
1206 - console.log("Started APF tunnel...");
1207 - } catch (e) {
1208 - console.log(JSON.stringify(e));
1142 + getMeiState(15, function (state) { // Flags: 1 = Versions, 2 = OsAdmin, 4 = Hashes, 8 = Network
1143 + // Connect to MPS and start APF relay
1144 + var apfarg = {
1145 + mpsurl: settings.url,
1146 + mpsuser: settings.id.substring(0, 16),
1147 + mpspass: settings.id.substring(0, 16),
1148 + mpskeepalive: 60000,
1149 + clientname: require('os').hostname(),
1150 + clientaddress: '127.0.0.1',
1151 + clientuuid: state.UUID,
1152 + conntype: 2, // 0 = CIRA, 1 = Relay, 2 = LMS. The correct value is 2 since we are performing an LMS relay.
1153 + meiState: state
1154 + };
1155 + if ((apfarg.clientuuid == null) || (apfarg.clientuuid.length != 36)) {
1156 + console.log("Unable to get Intel AMT UUID: " + apfarg.clientuuid);
1157 exit(1); return;
1158 + } else {
1159 + settings.apftunnel = require('apfclient')({ debug: (settings.debuglevel > 0) }, apfarg);
1160 + settings.apftunnel.onJsonControl = configureJsonControl;
1161 + settings.apftunnel.onChannelClosed = function () { exit(0); }
1162 + try {
1163 + settings.apftunnel.connect();
1164 + console.log("Started APF tunnel...");
1165 + } catch (e) {
1166 + console.log(JSON.stringify(e));
1167 + exit(1); return;
1168 + }
1169 }
1211 - }
1170 + });
1171 }
1172
1173 function configureJsonControl(data) {
1174 switch (data.action) {
1216 - case 'console':
1175 + case 'console': // Display a console message
1176 console.log(data.msg);
1177 break;
1219 - case 'close':
1178 + case 'mestate': // Request an updated MEI state
1179 + getMeiState(15, function (state) { settings.apftunnel.updateMeiState(state); });
1180 + break;
1181 + case 'close': // Close the CIRA-LMS connection
1182 exit(0);
1183 break;
1184 }
@@ -2983,6 +2945,40 @@ function performAmtPowerActionEx2(stack, name, response, status) {
2945 }
2946 }
2947
2948 +//
2949 +// Get MEI state
2950 +//
2951 +
2952 +// Get Intel MEI State in a flexible way
2953 +// Flags: 1 = Versions, 2 = OsAdmin, 4 = Hashes, 8 = Network
2954 +function getMeiState(flags, func) {
2955 + var amtMeiModule, amtMei;
2956 + try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { func(null); return; }
2957 + amtMei.on('error', function (e) { func(null); return; });
2958 + try {
2959 + var amtMeiTmpState = { Flags: 0 }; // Flags: 1=EHBC, 2=CCM, 4=ACM
2960 + amtMei.getProtocolVersion(function (result) { if (result != null) { amtMeiTmpState.MeiVersion = result; } });
2961 + if ((flags & 1) != 0) { amtMei.getVersion(function (result) { if (result) { amtMeiTmpState.Versions = {}; for (var version in result.Versions) { amtMeiTmpState.Versions[result.Versions[version].Description] = result.Versions[version].Version; } } }); }
2962 + amtMei.getProvisioningMode(function (result) { if (result) { amtMeiTmpState.ProvisioningMode = result.mode; } });
2963 + amtMei.getProvisioningState(function (result) { if (result) { amtMeiTmpState.ProvisioningState = result.state; } }); // 0: "Not Activated (Pre)", 1: "Not Activated (In)", 2: "Activated"
2964 + amtMei.getEHBCState(function (result) { if ((result != null) && (result.EHBC == true)) { amtMeiTmpState.Flags += 1; } });
2965 + amtMei.getControlMode(function (result) { if (result != null) { if (result.controlMode == 1) { amtMeiTmpState.Flags += 2; } if (result.controlMode == 2) { amtMeiTmpState.Flags += 4; } } }); // Flag 2 = CCM, 4 = ACM
2966 + //amtMei.getMACAddresses(function (result) { if (result) { amtMeiTmpState.mac = result; } });
2967 + if ((flags & 8) != 0) { amtMei.getLanInterfaceSettings(0, function (result) { if (result) { amtMeiTmpState.net0 = result; } }); }
2968 + if ((flags & 8) != 0) { amtMei.getLanInterfaceSettings(1, function (result) { if (result) { amtMeiTmpState.net1 = result; } }); }
2969 + amtMei.getUuid(function (result) { if ((result != null) && (result.uuid != null)) { amtMeiTmpState.UUID = result.uuid; } });
2970 + if ((flags & 2) != 0) { amtMei.getLocalSystemAccount(function (x) { if ((x != null) && x.user && x.pass) { amtMeiTmpState.OsAdmin = { user: x.user, pass: x.pass }; } }); }
2971 + amtMei.getDnsSuffix(function (result) { if (result != null) { amtMeiTmpState.DNS = result; } if ((flags & 4) == 0) { if (func != null) { func(amtMeiTmpState); } } });
2972 + if ((flags & 4) != 0) {
2973 + amtMei.getHashHandles(function (handles) {
2974 + if (handles != null) { amtMeiTmpState.Hashes = []; } else { func(amtMeiTmpState); }
2975 + var exitOnCount = handles.length;
2976 + for (var i = 0; i < handles.length; ++i) { this.getCertHashEntry(handles[i], function (hashresult) { amtMeiTmpState.Hashes.push(hashresult); if (--exitOnCount == 0) { if (func != null) { func(amtMeiTmpState); } } }); }
2977 + });
2978 + }
2979 + } catch (e) { if (func != null) { func(null); } return; }
2980 +}
2981 +
2982
2983 //
2984 // Startup
agents/meshcore.js
+63 -19
@@ -3541,26 +3541,40 @@ function createMeshCore(agent) {
3541 break;
3542 }
3543 case 'amtconfig': {
3544 - if (meshCoreObj.intelamt == null) { response = "No Intel AMT support delected"; break; }
3544 if (apftunnel != null) { response = "Intel AMT server tunnel already active"; break; }
3546 - var apfarg = {
3547 - mpsurl: mesh.ServerUrl.replace('agent.ashx', 'apf.ashx'),
3548 - mpsuser: Buffer.from(mesh.ServerInfo.MeshID, 'hex').toString('base64').substring(0, 16),
3549 - mpspass: Buffer.from(mesh.ServerInfo.MeshID, 'hex').toString('base64').substring(0, 16),
3550 - mpskeepalive: 60000,
3551 - clientname: require('os').hostname(),
3552 - clientaddress: '127.0.0.1',
3553 - clientuuid: meshCoreObj.intelamt.uuid,
3554 - conntype: 2 // 0 = CIRA, 1 = Relay, 2 = LMS. The correct value is 2 since we are performing an LMS relay, other values for testing.
3555 - };
3556 - if ((apfarg.clientuuid == null) || (apfarg.clientuuid.length != 36)) { response = "Unable to get Intel AMT UUID"; break; }
3557 - apftunnel = require('apfclient')({ debug: false }, apfarg);
3558 - apftunnel.onJsonControl = function (data) {
3559 - if (data.action == 'console') { require('MeshAgent').SendCommand({ action: 'msg', type: 'console', value: data.msg }); }
3560 - if (data.action == 'close') { try { apftunnel.disconnect(); } catch (e) { } apftunnel = null; }
3561 - }
3562 - apftunnel.onChannelClosed = function () { apftunnel = null; }
3563 - try { apftunnel.connect(); response = "Started Intel AMT configuration"; } catch (ex) { response = JSON.stringify(ex); }
3545 + if (amt == null) { response = "No Intel AMT support delected"; break; }
3546 + getMeiState(15, function (state) {
3547 + var rx = '';
3548 + var apfarg = {
3549 + mpsurl: mesh.ServerUrl.replace('agent.ashx', 'apf.ashx'),
3550 + mpsuser: Buffer.from(mesh.ServerInfo.MeshID, 'hex').toString('base64').substring(0, 16),
3551 + mpspass: Buffer.from(mesh.ServerInfo.MeshID, 'hex').toString('base64').substring(0, 16),
3552 + mpskeepalive: 60000,
3553 + clientname: require('os').hostname(),
3554 + clientaddress: '127.0.0.1',
3555 + clientuuid: state.UUID,
3556 + conntype: 2, // 0 = CIRA, 1 = Relay, 2 = LMS. The correct value is 2 since we are performing an LMS relay, other values for testing.
3557 + meiState: state // MEI state will be passed to MPS server
3558 + };
3559 + if ((state.UUID == null) || (state.UUID.length != 36)) {
3560 + rx = "Unable to get Intel AMT UUID";
3561 + } else {
3562 + apftunnel = require('apfclient')({ debug: false }, apfarg);
3563 + apftunnel.onJsonControl = function (data) {
3564 + if (data.action == 'console') { require('MeshAgent').SendCommand({ action: 'msg', type: 'console', value: data.msg }); } // Display a console message
3565 + if (data.action == 'mestate') { getMeiState(15, function (state) { apftunnel.updateMeiState(state); }); } // Update the MEI state
3566 + if (data.action == 'close') { try { apftunnel.disconnect(); } catch (e) { } apftunnel = null; } // Close the CIRA-LMS connection
3567 + }
3568 + apftunnel.onChannelClosed = function () { apftunnel = null; }
3569 + try {
3570 + apftunnel.connect();
3571 + rx = "Started Intel AMT configuration";
3572 + } catch (ex) {
3573 + rx = JSON.stringify(ex);
3574 + }
3575 + }
3576 + if (rx != '') { require('MeshAgent').SendCommand({ action: 'msg', type: 'console', value: rx }); }
3577 + });
3578 break;
3579 }
3580 case 'apf': {
@@ -3819,6 +3833,36 @@ function createMeshCore(agent) {
3833 s.data = onWebSocketData;
3834 }
3835
3836 + // Get Intel MEI State in a flexible way
3837 + // Flags: 1 = Versions, 2 = OsAdmin, 4 = Hashes, 8 = Network
3838 + function getMeiState(flags, func) {
3839 + var amtMeiModule, amtMei;
3840 + try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { func(null); return; }
3841 + amtMei.on('error', function (e) { func(null); return; });
3842 + try {
3843 + var amtMeiTmpState = { Flags: 0 }; // Flags: 1=EHBC, 2=CCM, 4=ACM
3844 + amtMei.getProtocolVersion(function (result) { if (result != null) { amtMeiTmpState.MeiVersion = result; } });
3845 + if ((flags & 1) != 0) { amtMei.getVersion(function (result) { if (result) { amtMeiTmpState.Versions = {}; for (var version in result.Versions) { amtMeiTmpState.Versions[result.Versions[version].Description] = result.Versions[version].Version; } } }); }
3846 + amtMei.getProvisioningMode(function (result) { if (result) { amtMeiTmpState.ProvisioningMode = result.mode; } });
3847 + amtMei.getProvisioningState(function (result) { if (result) { amtMeiTmpState.ProvisioningState = result.state; } }); // 0: "Not Activated (Pre)", 1: "Not Activated (In)", 2: "Activated"
3848 + amtMei.getEHBCState(function (result) { if ((result != null) && (result.EHBC == true)) { amtMeiTmpState.Flags += 1; } });
3849 + amtMei.getControlMode(function (result) { if (result != null) { if (result.controlMode == 1) { amtMeiTmpState.Flags += 2; } if (result.controlMode == 2) { amtMeiTmpState.Flags += 4; } } }); // Flag 2 = CCM, 4 = ACM
3850 + //amtMei.getMACAddresses(function (result) { if (result) { amtMeiTmpState.mac = result; } });
3851 + if ((flags & 8) != 0) { amtMei.getLanInterfaceSettings(0, function (result) { if (result) { amtMeiTmpState.net0 = result; } }); }
3852 + if ((flags & 8) != 0) { amtMei.getLanInterfaceSettings(1, function (result) { if (result) { amtMeiTmpState.net1 = result; } }); }
3853 + amtMei.getUuid(function (result) { if ((result != null) && (result.uuid != null)) { amtMeiTmpState.UUID = result.uuid; } });
3854 + if ((flags & 2) != 0) { amtMei.getLocalSystemAccount(function (x) { if ((x != null) && x.user && x.pass) { amtMeiTmpState.OsAdmin = { user: x.user, pass: x.pass }; } }); }
3855 + amtMei.getDnsSuffix(function (result) { if (result != null) { amtMeiTmpState.DNS = result; } if ((flags & 4) == 0) { if (func != null) { func(amtMeiTmpState); } } });
3856 + if ((flags & 4) != 0) {
3857 + amtMei.getHashHandles(function (handles) {
3858 + if (handles != null) { amtMeiTmpState.Hashes = []; } else { func(amtMeiTmpState); }
3859 + var exitOnCount = handles.length;
3860 + for (var i = 0; i < handles.length; ++i) { this.getCertHashEntry(handles[i], function (hashresult) { amtMeiTmpState.Hashes.push(hashresult); if (--exitOnCount == 0) { if (func != null) { func(amtMeiTmpState); } } }); }
3861 + });
3862 + }
3863 + } catch (e) { if (func != null) { func(null); } return; }
3864 + }
3865 +
3866 return obj;
3867 }
3868
agents/modules_meshcmd/apfclient.js
+6 -1
@@ -173,11 +173,16 @@ function CreateAPFClient(parent, args) {
173 });
174
175 obj.state = CIRASTATE.INITIAL;
176 - if ((typeof obj.args.conntype == 'number') && (obj.args.conntype != 0)) { SendJsonControl(obj.forwardClient.ws, { action: 'connType', value: obj.args.conntype } ); }
176 + if ((typeof obj.args.conntype == 'number') && (obj.args.conntype != 0)) {
177 + SendJsonControl(obj.forwardClient.ws, { action: 'connType', value: obj.args.conntype });
178 + if (obj.args.meiState != null) { SendJsonControl(obj.forwardClient.ws, { action: 'meiState', value: obj.args.meiState }); }
179 + }
180 SendProtocolVersion(obj.forwardClient.ws, obj.args.clientuuid);
181 SendServiceRequest(obj.forwardClient.ws, 'auth@amt.intel.com');
182 }
183
184 + obj.updateMeiState = function (state) { SendJsonControl(obj.forwardClient.ws, { action: 'meiState', value: state }); }
185 +
186 function SendJsonControl(socket, o) {
187 var data = JSON.stringify(o)
188 socket.write(String.fromCharCode(APFProtocol.JSON_CONTROL) + IntToStr(data.length) + data);
agents/modules_meshcore/apfclient.js
+6 -1
@@ -173,11 +173,16 @@ function CreateAPFClient(parent, args) {
173 });
174
175 obj.state = CIRASTATE.INITIAL;
176 - if ((typeof obj.args.conntype == 'number') && (obj.args.conntype != 0)) { SendJsonControl(obj.forwardClient.ws, { action: 'connType', value: obj.args.conntype } ); }
176 + if ((typeof obj.args.conntype == 'number') && (obj.args.conntype != 0)) {
177 + SendJsonControl(obj.forwardClient.ws, { action: 'connType', value: obj.args.conntype });
178 + if (obj.args.meiState != null) { SendJsonControl(obj.forwardClient.ws, { action: 'meiState', value: obj.args.meiState }); }
179 + }
180 SendProtocolVersion(obj.forwardClient.ws, obj.args.clientuuid);
181 SendServiceRequest(obj.forwardClient.ws, 'auth@amt.intel.com');
182 }
183
184 + obj.updateMeiState = function (state) { SendJsonControl(obj.forwardClient.ws, { action: 'meiState', value: state }); }
185 +
186 function SendJsonControl(socket, o) {
187 var data = JSON.stringify(o)
188 socket.write(String.fromCharCode(APFProtocol.JSON_CONTROL) + IntToStr(data.length) + data);
meshagent.js
+7 -2
@@ -899,6 +899,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
899 }
900
901 // Take a basic Intel AMT policy and add all server information to it, making it ready to send to this agent.
902 + /*
903 function completeIntelAmtPolicy(amtPolicy) {
904 var r = amtPolicy;
905 if (amtPolicy == null) return null;
@@ -923,12 +924,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
924 }
925 return r;
926 }
927 + */
928
929 // Send Intel AMT policy
930 obj.sendUpdatedIntelAmtPolicy = function (policy) {
931 if (obj.agentExeInfo && (obj.agentExeInfo.amt == true)) { // Only send Intel AMT policy to agents what could have AMT.
930 - if (policy == null) { var mesh = parent.meshes[obj.dbMeshKey]; if (mesh == null) return; policy = mesh.amt; }
931 - if (policy != null) { try { obj.send(JSON.stringify({ action: 'amtPolicy', amtPolicy: completeIntelAmtPolicy(common.Clone(policy)) })); } catch (ex) { } }
932 + // TODO
933 + //if (policy == null) { var mesh = parent.meshes[obj.dbMeshKey]; if (mesh == null) return; policy = mesh.amt; }
934 + //if (policy != null) { try { obj.send(JSON.stringify({ action: 'amtPolicy', amtPolicy: completeIntelAmtPolicy(common.Clone(policy)) })); } catch (ex) { } }
935 }
936 }
937
@@ -981,9 +984,11 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
984 });
985
986 // Send Intel AMT policy
987 + /*
988 if (obj.agentExeInfo && (obj.agentExeInfo.amt == true) && (mesh.amt != null)) { // Only send Intel AMT policy to agents what could have AMT.
989 try { obj.send(JSON.stringify({ action: 'amtPolicy', amtPolicy: completeIntelAmtPolicy(common.Clone(mesh.amt)) })); } catch (ex) { }
990 }
991 + */
992
993 // Fetch system information
994 db.GetHash('si' + obj.dbNodeKey, function (err, results) {
mpsserver.js
+7
@@ -894,6 +894,13 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
894 if ((socket.tag.connType != 0) || (socket.tag.SystemId != null)) return; // Once set, the connection type can't be changed.
895 if (typeof jsondata.value != 'number') return;
896 socket.tag.connType = jsondata.value; // 0 = CIRA, 1 = Relay, 2 = LMS
897 + //obj.SendJsonControl(socket, { action: 'mestate' }); // Request an MEI state refresh
898 + break;
899 + case 'meiState':
900 + if (socket.tag.connType != 2) break; // Only accept MEI state on CIRA-LMS connection
901 + socket.tag.meiState = jsondata.value;
902 + //if (socket.tag.meiState.UUID != null) { console.log('MEI State', socket.tag.meiState.UUID); }
903 + //console.log('meiState', JSON.stringify(socket.tag.meiState, null, 2)); // DEBUG
904 break;
905 }
906 return 5 + jsondatalen;