1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed Intel AMT stack, exec with cert references would not work.

This commit is contained in:
Ylian Saint-Hilaire 2022-04-07 11:09:25 -07:00
parent 90d2d7b21b
commit ef72e5d393
3 changed files with 38 additions and 51 deletions

View file

@ -1709,6 +1709,7 @@ module.exports.CreateAmtManager = function (parent) {
const wiredConfig = devNetAuthData.wiredConfig;
const wirelessConfig = devNetAuthData.wirelessConfig;
var taskCounter = 0;
if (wirelessConfig) {
// Add missing WIFI profiles
var nextPriority = 1;
@ -1748,7 +1749,6 @@ module.exports.CreateAmtManager = function (parent) {
if (domain.amtmanager['802.1x'].domain) { netAuthProfile['Domain'] = domain.amtmanager['802.1x'].domain; }
if (domain.amtmanager['802.1x'].authenticationprotocol > 3) { domain.amtmanager['ProtectedAccessCredential'] = profileToAdd['802.1x'].protectedaccesscredentialhex; netAuthProfile['PACPassword'] = profileToAdd['802.1x'].pacpassword; }
/*
// Setup Client Certificate
if (devNetAuthData.certInstanceId) {
netAuthSettingsClientCert = '<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">' + devNetAuthData.certInstanceId + '</w:Selector></w:SelectorSet></a:ReferenceParameters>';
@ -1757,16 +1757,6 @@ module.exports.CreateAmtManager = function (parent) {
if (devNetAuthData.rootCertInstanceId) {
netAuthSettingsServerCaCert = '<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">' + devNetAuthData.rootCertInstanceId + '</w:Selector></w:SelectorSet></a:ReferenceParameters>';
}
*/
// Setup Client Certificate
if (devNetAuthData.certInstanceId) {
netAuthSettingsClientCert = '<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">' + devNetAuthData.certInstanceId + '</Selector></SelectorSet></ReferenceParameters>';
}
// Setup Server Certificate
if (devNetAuthData.rootCertInstanceId) {
netAuthSettingsServerCaCert = '<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">' + devNetAuthData.rootCertInstanceId + '</Selector></SelectorSet></ReferenceParameters>';
}
// If we have credentials from MeshCentral Satelite, use that
if (dev.netAuthCredentials != null) {
@ -1777,25 +1767,20 @@ module.exports.CreateAmtManager = function (parent) {
}
}
prioritiesInUse.push(nextPriority); // Occupy the priority slot and add the WIFI profile.
console.log('AddWiFiSettings1');
taskCounter++;
dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, netAuthProfile, netAuthSettingsClientCert, netAuthSettingsServerCaCert, function (stack, name, response, status) {
if (status != 200) { dev.consoleMsg("Unable to set WIFI profile."); }
console.log('AddWiFiSettings2', status, response);
if (--taskCounter == 0) { attemptWifiSyncEx2(dev, devNetAuthData); } // All done, complete WIFI configuration
});
}
// Complete WIFI configuration
attemptWifiSyncEx2(dev, devNetAuthData);
} else {
// Done
devTaskCompleted(dev);
}
if (taskCounter == 0) { attemptWifiSyncEx2(dev, devNetAuthData); } // All done, complete WIFI configuration
}
function attemptWifiSyncEx2(dev, devNetAuthData) {
if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.
const responses = devNetAuthData.responses;
// Check if local WIFI profile sync is enabled, if not, enabled it.
@ -1825,8 +1810,6 @@ module.exports.CreateAmtManager = function (parent) {
}
}
console.log('ALL GOOD');
// Done
devTaskCompleted(dev);
}