diff --git a/amtmanager.js b/amtmanager.js index 4d02a3f1..5f71aa21 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -1052,84 +1052,94 @@ module.exports.CreateAmtManager = function (parent) { if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. if (dev.policy.amtPolicy == 0) { func(dev); return; } // If there is no Intel AMT policy, skip this operation. if (dev.connType != 2) { func(dev); return; } // Only configure wireless over a CIRA-LMS link - if (parent.config.domains[dev.domainid].amtmanager.wifiprofiles == null) { func(dev); return; } // No server WIFI profiles set, skip this. + //if (parent.config.domains[dev.domainid].amtmanager.wifiprofiles == null) { func(dev); return; } // No server WIFI profiles set, skip this. if ((dev.mpsConnection.tag.meiState == null) || (dev.mpsConnection.tag.meiState.net1 == null)) { func(dev); return; } // No WIFI on this device, skip this. - // Get the current list of WIFI profiles + // Get the current list of WIFI profiles and wireless interface state dev.taskCount = 1; dev.taskCompleted = func; - dev.amtstack.BatchEnum(null, ['CIM_WiFiEndpointSettings', '*CIM_WiFiPort'], function (stack, name, responses, status) { + dev.amtstack.BatchEnum(null, ['CIM_WiFiEndpointSettings', '*CIM_WiFiPort', '*AMT_WiFiPortConfigurationService'], function (stack, name, responses, status) { const dev = stack.dev; if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. if (status != 200) { devTaskCompleted(dev); return; } // We can't get wireless settings, ignore and carry on. - // The server and device WIFI profiles, find profiles to add and remove - const sevProfiles = parent.config.domains[dev.domainid].amtmanager.wifiprofiles; - const devProfiles = responses['CIM_WiFiEndpointSettings'].responses; - var profilesToAdd = [], profilesToRemove = []; + // If we have server WIFI profiles to sync, do this now. + if (parent.config.domains[dev.domainid].amtmanager.wifiprofiles != null) { + // The server and device WIFI profiles, find profiles to add and remove + const sevProfiles = parent.config.domains[dev.domainid].amtmanager.wifiprofiles; + const devProfiles = responses['CIM_WiFiEndpointSettings'].responses; + var profilesToAdd = [], profilesToRemove = []; - // Look at the WIFI profiles in the device - for (var i in sevProfiles) { - var sevProfile = sevProfiles[i], match = false; + // Look at the WIFI profiles in the device + for (var i in sevProfiles) { + var sevProfile = sevProfiles[i], match = false; + for (var j in devProfiles) { + var devProfile = devProfiles[j]; + if ( + (devProfile.ElementName == sevProfile.name) && + (devProfile.SSID == sevProfile.ssid) && + (devProfile.AuthenticationMethod == sevProfile.authentication) && + (devProfile.EncryptionMethod == sevProfile.encryption) && + (devProfile.BSSType == sevProfile.type) + ) { match = true; devProfile.match = true; } + } + if (match == false) { profilesToAdd.push(sevProfile); } + } for (var j in devProfiles) { var devProfile = devProfiles[j]; - if ( - (devProfile.ElementName == sevProfile.name) && - (devProfile.SSID == sevProfile.ssid) && - (devProfile.AuthenticationMethod == sevProfile.authentication) && - (devProfile.EncryptionMethod == sevProfile.encryption) && - (devProfile.BSSType == sevProfile.type) - ) { match = true; devProfile.match = true; } + if (devProfile.match !== true) { profilesToRemove.push(devProfile); } } - if (match == false) { profilesToAdd.push(sevProfile); } - } - for (var j in devProfiles) { - var devProfile = devProfiles[j]; - if (devProfile.match !== true) { profilesToRemove.push(devProfile); } - } - // Compute what priorities are allowed - var prioritiesInUse = []; - for (var j in devProfiles) { if (devProfiles[j].match == true) { prioritiesInUse.push(devProfiles[j].Priority); } } + // Compute what priorities are allowed + var prioritiesInUse = []; + for (var j in devProfiles) { if (devProfiles[j].match == true) { prioritiesInUse.push(devProfiles[j].Priority); } } - // Notify of WIFI profile changes - if ((profilesToAdd.length > 0) || (profilesToRemove.length > 0)) { dev.consoleMsg("Changing WIFI profiles, adding " + profilesToAdd.length + ", removing " + profilesToRemove.length + "."); } + // Notify of WIFI profile changes + if ((profilesToAdd.length > 0) || (profilesToRemove.length > 0)) { dev.consoleMsg("Changing WIFI profiles, adding " + profilesToAdd.length + ", removing " + profilesToRemove.length + "."); } - // Remove any extra WIFI profiles - for (var i in profilesToRemove) { - dev.amtstack.Delete('CIM_WiFiEndpointSettings', { InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + profilesToRemove[i].ElementName }, function (stack, name, responses, status) { }, 0, 1); - } - - // Add missing WIFI profiles - var nextPriority = 0; - for (var i in profilesToAdd) { - while (prioritiesInUse.indexOf(nextPriority) >= 0) { nextPriority++; } // Figure out the next available priority slot. - var profileToAdd = profilesToAdd[i]; - const wifiep = { - __parameterType: 'reference', - __resourceUri: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint', - Name: 'WiFi Endpoint 0' - }; - const wifiepsettinginput = { - __parameterType: 'instance', - __namespace: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings', - ElementName: profileToAdd.name, - InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + profileToAdd.name, - AuthenticationMethod: profileToAdd.authentication, - EncryptionMethod: profileToAdd.encryption, - SSID: profileToAdd.ssid, - Priority: nextPriority, - PSKPassPhrase: profileToAdd.password + // Remove any extra WIFI profiles + for (var i in profilesToRemove) { + dev.amtstack.Delete('CIM_WiFiEndpointSettings', { InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + profilesToRemove[i].ElementName }, function (stack, name, responses, status) { }, 0, 1); + } + + // Add missing WIFI profiles + var nextPriority = 0; + for (var i in profilesToAdd) { + while (prioritiesInUse.indexOf(nextPriority) >= 0) { nextPriority++; } // Figure out the next available priority slot. + var profileToAdd = profilesToAdd[i]; + const wifiep = { + __parameterType: 'reference', + __resourceUri: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint', + Name: 'WiFi Endpoint 0' + }; + const wifiepsettinginput = { + __parameterType: 'instance', + __namespace: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings', + ElementName: profileToAdd.name, + InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + profileToAdd.name, + AuthenticationMethod: profileToAdd.authentication, + EncryptionMethod: profileToAdd.encryption, + SSID: profileToAdd.ssid, + Priority: nextPriority, + PSKPassPhrase: profileToAdd.password + } + prioritiesInUse.push(nextPriority); // Occupy the priority slot and add the WIFI profile. + dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, null, null, null, function (stack, name, responses, status) { }); } - prioritiesInUse.push(nextPriority); // Occupy the priority slot and add the WIFI profile. - dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, null, null, null, function (stack, name, responses, status) { }); } - // Compute how many WIFI profiles will be in the device and change the state if needed + // Check if local WIFI profile sync is enabled, if not, enabled it. + if ((responses['AMT_WiFiPortConfigurationService'] != null) && (responses['AMT_WiFiPortConfigurationService'].response != null) && (responses['AMT_WiFiPortConfigurationService'].response['localProfileSynchronizationEnabled'] == 0)) { + responses['AMT_WiFiPortConfigurationService'].response['localProfileSynchronizationEnabled'] = 1; + dev.amtstack.Put('AMT_WiFiPortConfigurationService', responses['AMT_WiFiPortConfigurationService'].response, function (stack, name, response, status) { + if (status != 200) { dev.consoleMsg("Unable to enable local WIFI profile sync."); } else { dev.consoleMsg("Enabled local WIFI profile sync."); } + }); + } + + // Change the WIFI state if needed. Right now, we always enable it. // WifiState = { 3: "Disabled", 32768: "Enabled in S0", 32769: "Enabled in S0, Sx/AC" }; - var resultingProfileCount = (devProfiles.length + profilesToAdd.length - profilesToRemove.length); - var wifiState = (resultingProfileCount == 0) ? 3 : 32769; - if (responses['CIM_WiFiPort'].responses.Body.EnabledState != wifiState) { + var wifiState = 32769; // For now, always enable WIFI + if (responses['CIM_WiFiPort'].responses.Body.EnabledState != 32769) { if (wifiState == 3) { dev.amtstack.CIM_WiFiPort_RequestStateChange(wifiState, null, function (stack, name, responses, status) { const dev = stack.dev; diff --git a/public/commander.htm b/public/commander.htm index 5c2b3f99..08e44abf 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -428,7 +428,7 @@ q;b=c(l,b-x.digestLength-1,q);d=a.util.xorBytes(d,b,d.length);x=c(d,x.digestLeng 0),g&=m,b+=g;if(l||1!==d.charCodeAt(b))throw Error("Invalid RSAES-OAEP padding.");return d.substring(b+1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var v,q=function(a,c){c.exports=function(c){var e=v.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs1)return c.pkcs1;c.defined.pkcs1=!0;for(var n=0;nb&&(g=l(b,c));if(g.isProbablePrime(n))return k(null,g);g.dAddOffset(h[w++%8],0)}while(0>m||+new Date-ub&&(w=l(b,c));n=w.toString(16);p.target.postMessage({hex:n,workLoad:u}); -w.dAddOffset(q,0)}}m=Math.max(1,m);for(var d=[],p=0;p=a?27:150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if(!a.prime){var m=a.prime=a.prime||{},g=a.jsbn.BigInteger,h=[6,4,2,4,2,4,6,2],u=new g(null);u.fromInt(30);var v=function(a,b){return a|b};m.generateProbablePrime=function(b,d,e){"function"===typeof d&&(e=d,d={});d=d||{};var h=d.algorithm||"PRIMEINC";"string"===typeof h&&(h={name:h});h.options=h.options||{};var k=d.prng||a.random;d={nextBytes:function(a){for(var b=k.getBytesSync(a.length), c=0;cd-11)throw h= @@ -587,14 +587,14 @@ u,{name:"PFX.macData",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructe tagClass:m.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:m.Class.UNIVERSAL,type:m.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:m.Class.UNIVERSAL,type:m.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:m.Class.UNIVERSAL,type:m.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},H={name:"SafeBag",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0, value:[{name:"SafeBag.bagId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:m.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:m.Class.UNIVERSAL,type:m.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},y={name:"Attribute",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1, capture:"oid"},{name:"Attribute.attrValues",tagClass:m.Class.UNIVERSAL,type:m.Type.SET,constructed:!0,capture:"values"}]},B={name:"CertBag",tagClass:m.Class.UNIVERSAL,type:m.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:m.Class.UNIVERSAL,type:m.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:m.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:m.Class.UNIVERSAL,type:m.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]}; -h.pkcs12FromAsn1=function(b,l,w){"string"===typeof l?(w=l,l=!0):void 0===l&&(l=!0);var u={};if(!m.validate(b,v,u,[]))throw l=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),l.errors=l,l;var q={version:u.version.charCodeAt(0),safeContents:[],getBags:function(b){var d={},e;"localKeyId"in b?e=b.localKeyId:"localKeyIdHex"in b&&(e=a.util.hexToBytes(b.localKeyIdHex));void 0===e&&!("friendlyName"in b)&&"bagType"in b&&(d[b.bagType]=c(q.safeContents,null,null,b.bagType));void 0!==e&& -(d.localKeyId=c(q.safeContents,"localKeyId",e,b.bagType));"friendlyName"in b&&(d.friendlyName=c(q.safeContents,"friendlyName",b.friendlyName,b.bagType));return d},getBagsByFriendlyName:function(a,b){return c(q.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return c(q.safeContents,"localKeyId",a,b)}};if(3!==u.version.charCodeAt(0))throw l=Error("PKCS#12 PFX of version other than 3 not supported."),l.version=u.version.charCodeAt(0),l;if(m.derToOid(u.contentType)!==g.oids.data)throw l= -Error("Only PKCS#12 PFX in password integrity mode supported."),l.oid=m.derToOid(u.contentType),l;b=u.content.value[0];if(b.tagClass!==m.Class.UNIVERSAL||b.type!==m.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");b=d(b);if(u.mac){var y=null,B=0,r=m.derToOid(u.macAlgorithm);switch(r){case g.oids.sha1:y=a.md.sha1.create();B=20;break;case g.oids.sha256:y=a.md.sha256.create();B=32;break;case g.oids.sha384:y=a.md.sha384.create();B=48;break;case g.oids.sha512:y=a.md.sha512.create(); -B=64;break;case g.oids.md5:y=a.md.md5.create(),B=16}if(null===y)throw Error("PKCS#12 uses unsupported MAC algorithm: "+r);var r=new a.util.ByteBuffer(u.macSalt),A="macIterations"in u?parseInt(a.util.bytesToHex(u.macIterations),16):1,B=h.generateKey(w,r,3,A,B,y),r=a.hmac.create();r.start(y,B);r.update(b.value);if(r.getMac().getBytes()!==u.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(q,b.value,l,w);return q};h.toPkcs12Asn1=function(b,c,d,e){e=e||{};e.saltSize=e.saltSize|| +h.pkcs12FromAsn1=function(b,l,w){"string"===typeof l?(w=l,l=!0):void 0===l&&(l=!0);var q={};if(!m.validate(b,v,q,[]))throw l=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),l.errors=l,l;var u={version:q.version.charCodeAt(0),safeContents:[],getBags:function(b){var d={},e;"localKeyId"in b?e=b.localKeyId:"localKeyIdHex"in b&&(e=a.util.hexToBytes(b.localKeyIdHex));void 0===e&&!("friendlyName"in b)&&"bagType"in b&&(d[b.bagType]=c(u.safeContents,null,null,b.bagType));void 0!==e&& +(d.localKeyId=c(u.safeContents,"localKeyId",e,b.bagType));"friendlyName"in b&&(d.friendlyName=c(u.safeContents,"friendlyName",b.friendlyName,b.bagType));return d},getBagsByFriendlyName:function(a,b){return c(u.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return c(u.safeContents,"localKeyId",a,b)}};if(3!==q.version.charCodeAt(0))throw l=Error("PKCS#12 PFX of version other than 3 not supported."),l.version=q.version.charCodeAt(0),l;if(m.derToOid(q.contentType)!==g.oids.data)throw l= +Error("Only PKCS#12 PFX in password integrity mode supported."),l.oid=m.derToOid(q.contentType),l;b=q.content.value[0];if(b.tagClass!==m.Class.UNIVERSAL||b.type!==m.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");b=d(b);if(q.mac){var y=null,B=0,r=m.derToOid(q.macAlgorithm);switch(r){case g.oids.sha1:y=a.md.sha1.create();B=20;break;case g.oids.sha256:y=a.md.sha256.create();B=32;break;case g.oids.sha384:y=a.md.sha384.create();B=48;break;case g.oids.sha512:y=a.md.sha512.create(); +B=64;break;case g.oids.md5:y=a.md.md5.create(),B=16}if(null===y)throw Error("PKCS#12 uses unsupported MAC algorithm: "+r);var r=new a.util.ByteBuffer(q.macSalt),A="macIterations"in q?parseInt(a.util.bytesToHex(q.macIterations),16):1,B=h.generateKey(w,r,3,A,B,y),r=a.hmac.create();r.start(y,B);r.update(b.value);if(r.getMac().getBytes()!==q.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(u,b.value,l,w);return u};h.toPkcs12Asn1=function(b,c,d,e){e=e||{};e.saltSize=e.saltSize|| 8;e.count=e.count||2048;e.algorithm=e.algorithm||e.encAlgorithm||"aes128";"useMac"in e||(e.useMac=!0);"localKeyId"in e||(e.localKeyId=null);"generateLocalKeyId"in e||(e.generateLocalKeyId=!0);var k=e.localKeyId,l;if(null!==k)k=a.util.hexToBytes(k);else if(e.generateLocalKeyId)if(c){var n=a.util.isArray(c)?c[0]:c;"string"===typeof n&&(n=g.certificateFromPem(n));k=a.md.sha1.create();k.update(m.toDer(g.certificateToAsn1(n)).getBytes());k=k.digest().getBytes()}else k=a.random.getBytes(20);n=[];null!== k&&n.push(m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.localKeyId).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,k)])]));"friendlyName"in e&&n.push(m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.friendlyName).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.SET,!0,[m.create(m.Class.UNIVERSAL,m.Type.BMPSTRING,!1,e.friendlyName)])])); -0

General Settings

"+TableStart();e="";"None"!=c&&(1==v.SharedFQDN&&(e=", shared with OS"),0==v.SharedFQDN&&(e=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(c+e,"showEditNameDlg(1)",xxAccountAdminName));c="Disabled";1==v.DDNSUpdateEnabled?c="Enabled each "+v.DDNSPeriodicUpdateInterval+" minutes, TTL is "+v.DDNSTTL+" minutes":1==v.DDNSUpdateByDHCPServerEnabled&&(c="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(c,"showEditDnsDlg()", xxAccountAdminName));d+=TableEnd();for(a in amtsysstate.AMT_EthernetPortSettings.responses){c=amtsysstate.AMT_EthernetPortSettings.responses[a];if(c.WLANLinkProtectionLevel||1==a)amtwirelessif=a;if(0!=a||amtwirelessif==a||"00-00-00-00-00-00"!=c.MACAddress){0==a&&b++;d+="

"+(amtwirelessif==a?"Wireless Interface":"Wired Interface")+"

";d+=TableStart();d+=TableEntry("Link state",1==c.LinkIsUp?"Link is up":"Link is down");if(c.LinkPolicy){c.LinkPolicy=MakeToArray(c.LinkPolicy);e=[];for(k in c.LinkPolicy)1== c.LinkPolicy[k]&&e.push("S0/AC"),14==c.LinkPolicy[k]&&e.push("Sx/AC"),16==c.LinkPolicy[k]&&e.push("S0/DC"),224==c.LinkPolicy[k]&&e.push("Sx/DC");0==e.length&&e.push("");d+=TableEntry("Link policy",addLinkConditional(0==e.length?"Not available":"Available in: "+e.join(", "),"showLinkPolicyDlg("+a+")",xxAccountAdminName))}"00-00-00-00-00-00"!=c.MACAddress&&(d+=TableEntry("MAC address",c.MACAddress));amtwirelessif==a&&xxWireless&&xxWireless.CIM_WiFiPortCapabilities.response&&(d+=TableEntry("State",addLinkConditional(xxWifiState[xxWireless.CIM_WiFiPort.response.EnabledState], -"showWifiStateDlg()",xxAccountAdminName)),s=xxWireless.CIM_WiFiEndpoint.response.LANID,d+=TableEntry("Radio State",xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"None")));amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][v.PingResponseEnabled+(v.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),e=1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address", -1==c.IpSyncEnabled&&(e+=", IP sync with OS"),d+=TableEntry("IPv4 state",addLinkConditional(e,"showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",c.DefaultGateway+" / "+isIpAddress(c.SubnetMask,"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5None")),xxWireless.AMT_WiFiPortConfigurationService&&xxWireless.AMT_WiFiPortConfigurationService.response&&"number"==typeof xxWireless.AMT_WiFiPortConfigurationService.response.localProfileSynchronizationEnabled&&(d+=TableEntry("Local WIFI Profile Sync",addLinkConditional(1==xxWireless.AMT_WiFiPortConfigurationService.response.localProfileSynchronizationEnabled? +"Enabled":"Disabled","showWifiSyncDlg("+a+")",xxAccountAdminName))));amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][v.PingResponseEnabled+(v.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),e=1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address",1==c.IpSyncEnabled&&(e+=", IP sync with OS"),d+=TableEntry("IPv4 state",addLinkConditional(e,"showIPSetupDlg()",xxAccountAdminName))); +d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",c.DefaultGateway+" / "+isIpAddress(c.SubnetMask,"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5Available in S0/AC - Powered on & plugged in
");a+="
";a+="
";a+="
";setDialogMode(11,"Link Policy",3,showLinkPolicyDlgEx,a,b)}} function showLinkPolicyDlgEx(b,c){var a=Clone(amtsysstate.AMT_EthernetPortSettings.responses[c]);a.DHCPEnabled&&(delete a.IPAddress,delete a.SubnetMask,delete a.DefaultGateway,delete a.PrimaryDNS,delete a.SecondaryDNS);a.LinkPolicy=[];Q("d11p1").checked&&a.LinkPolicy.push(1);Q("d11p2").checked&&a.LinkPolicy.push(14);Q("d11p3").checked&&a.LinkPolicy.push(16);Q("d11p4").checked&&a.LinkPolicy.push(224);amtstack.Put("AMT_EthernetPortSettings",a,showLinkPolicyDlgExDone,0,1,a)} @@ -1121,12 +1121,14 @@ function AddDefensePolicyOk(){var b=Q("policytx").value,c=Q("policyrx").value,a= function AddDefensePolicyOk2(b,c,a,d){200!=d?messagebox("Add System Defense Policy","Unable to add policy, error #"+d):PullSystemDefense()} function showPolicyDetails(b){if(!xxdialogMode){var c=xxSystemDefense.AMT_SystemDefensePolicy.responses[b],a;a=""+addHtmlValue("Name",EscapeHtml(c.PolicyName));0!=c.PolicyPrecedence&&(a+=addHtmlValue("Precedence",c.PolicyPrecedence));var d=1==c.TxDefaultDrop?"Drop":"Allow";1==c.TxDefaultCount&&(d+=", Count");1==c.TxDefaultMatchEvent&&(d+=", Event");a+=addHtmlValue("Default TX Action",d);d=1==c.RxDefaultDrop?"Drop":"Allow";1==c.RxDefaultCount&&(d+=", Count");1==c.RxDefaultMatchEvent&&(d+=", Event"); a+=addHtmlValue("Default RX Action",d);if(c.FilterCreationHandles)for(b in c.FilterCreationHandles)a+=addHtmlValue("Filter #"+(+b+1),GetFilterById(c.FilterCreationHandles[b]).Name);setDialogMode(11,format("Policy #",c.InstanceID.substring(20)),5,showPolicyDetailsOk,a,c)}}function showPolicyDetailsOk(b,c){2==b&&amtstack.Delete("AMT_SystemDefensePolicy",c,deleteDefensePolicy)} -function deleteDefensePolicy(b,c,a,d){200!=d?messagebox("Remove Policy","Unable to remove policy, make sure it's not in use."):PullSystemDefense()}var xxWireless;function PullWireless(){amtFirstPull|=2;-1!=amtwirelessif&&amtstack.BatchEnum("",["*CIM_WiFiPortCapabilities","*CIM_WiFiPort","*CIM_WiFiEndpoint","CIM_WiFiEndpointSettings"],processWireless)}function wifiRefresh(){xxdialogMode||PullWireless()} +function deleteDefensePolicy(b,c,a,d){200!=d?messagebox("Remove Policy","Unable to remove policy, make sure it's not in use."):PullSystemDefense()}var xxWireless;function PullWireless(){amtFirstPull|=2;-1!=amtwirelessif&&amtstack.BatchEnum("",["*CIM_WiFiPortCapabilities","*CIM_WiFiPort","*CIM_WiFiEndpoint","CIM_WiFiEndpointSettings","*AMT_WiFiPortConfigurationService"],processWireless)}function wifiRefresh(){xxdialogMode||PullWireless()} var xxWifiState={3:"Disabled",32768:"Enabled in S0",32769:"Enabled in S0, Sx/AC"},xxRadioState={2:"On, Connected",3:"Off",6:"On, Disconnected"},xxWifiAuthenticationMethod={1:"Other",2:"Open",3:"Shared Key",4:"WPA PSK",5:"WPA IEEE 802.1x",6:"WPA2 PSK",7:"WPA2 IEEE 802.1x"},xxWifiEncryptionMethod={1:"Other",2:"WEP",3:"TKIP-RC4",4:"CCMP-AES",5:"None"};function processWireless(b,c,a,d){xxWireless=200==d?a:void 0;updateSystemStatus();showWirelessInfo()} function showWirelessInfo(){if(xxWireless){var b,c,a="",d,e;if(xxWireless.CIM_WiFiPortCapabilities.response){e="

Wireless Profiles

"+TableStart2();e+="
Wireless profiles that Intel® AMT will use for network connectivity.

";for(b=a=0;256>b;b++)for(c in xxWireless.CIM_WiFiEndpointSettings.responses)d=xxWireless.CIM_WiFiEndpointSettings.responses[c],1!=d.AuthenticationMethod&&d.Priority==b&&(e+="
"+EscapeHtml(d.SSID)+", "+xxWifiAuthenticationMethod[d.AuthenticationMethod]+", "+xxWifiEncryptionMethod[d.EncryptionMethod]+"   ",xxAccountAdminName&&(e+=AddButton2("Remove",'wifiRemoveButton("'+c+'")')),e+="
"+EscapeHtml(d.ElementName)+"
",a++);0==a&&(e+="No Wireless Profiles Present
");e+="
";e=xxAccountAdminName?e+TableEnd(AddButton("New Profile","showWifiNewProfile()")):e+TableEnd(""); QH(20,e+"
")}}}function showWifiStateDlg(){if(!xxdialogMode){var b="",c;for(c in xxWifiState)b+="
";setDialogMode(11,"Wireless State",3,wifiStateDlg,b)}} function wifiStateDlg(){amtstack.CIM_WiFiPort_RequestStateChange(document.querySelector("input[name=d11]:checked").value,null,function(){amtstack.Get("CIM_WiFiPort",function(b,c,a,d){200==d&&(xxWireless.CIM_WiFiPort.response=a.Body,showWirelessInfo())})})} +function showWifiSyncDlg(){if(!xxdialogMode){var b;b=""+("
");b+="
";setDialogMode(11,"Local Profile Sync",3,showWifiSyncDlgEx,b)}} +function showWifiSyncDlgEx(){var b=Clone(xxWireless.AMT_WiFiPortConfigurationService.response);b.localProfileSynchronizationEnabled=document.querySelector("input[name=d11]:checked").value;amtstack.Put("AMT_WiFiPortConfigurationService",b,function(){amtstack.Get("AMT_WiFiPortConfigurationService",function(b,a,d,e){200==e&&(xxWireless.AMT_WiFiPortConfigurationService.response=d.Body,showWirelessInfo())})})} function showWifiDetails(b){if(!xxdialogMode){b=xxWireless.CIM_WiFiEndpointSettings.responses[b];var c;c="
"+addHtmlValue("Profile Name",EscapeHtml(b.ElementName));c+=addHtmlValue("SSID",b.SSID);c+=addHtmlValue("Authentication",xxWifiAuthenticationMethod[b.AuthenticationMethod]);c+=addHtmlValue("Encryption",xxWifiEncryptionMethod[b.EncryptionMethod]);c+=addHtmlValue("Priority",b.Priority);messagebox("Wireless Profile",c+"
")}} function wifiRemoveButton(b){xxdialogMode||(QH(60,format('Remove wireless profile "{0}"?',xxWireless.CIM_WiFiEndpointSettings.responses[b].ElementName)),setDialogMode(1,"Wireless Profile",3,function(){removeWifiButtonEx(b)}))}function removeWifiButtonEx(b){amtstack.Delete("CIM_WiFiEndpointSettings",{InstanceID:xxWireless.CIM_WiFiEndpointSettings.responses[b].InstanceID},removeWifiEntryResponse,0,1)} function removeWifiEntryResponse(b,c,a,d,e){methodcheck(a)||amtstack.Enum("CIM_WiFiEndpointSettings",function(a,b,c,d){200==d&&(xxWireless.CIM_WiFiEndpointSettings.responses=c,showWirelessInfo())})} @@ -1316,9 +1318,9 @@ function powerActionResponse00(b,c,a,d){if(200==d){b=3;try{b=2==amtsysstate.CIM_ "Reset to diagnostic",301));9Enter Secure Erase password if required.

Password

WARNING: This will wipe data on the remote system.
", -rsepass=1,setDialogMode(11,"Power Actions",3,powerActionDlg,b);else if(106==b||107==b){var b="Confirm execution of Intel® Remote Platform Erase?

WARNING: This will wipe data on the remote system.
",c=[];amtPowerBootCapabilities.PlatformErase&2&&c.push("Pyrite Revert");amtPowerBootCapabilities.PlatformErase&4&&c.push("Secure Erase All SSDs");amtPowerBootCapabilities.PlatformErase&64&&c.push("TPM Clear");amtPowerBootCapabilities.PlatformErase&33554432&&c.push("Clear BIOS NVM Variables"); -amtPowerBootCapabilities.PlatformErase&67108864&&c.push("BIOS Reload of Golden Configuration");amtPowerBootCapabilities.PlatformErase&-2147483648&&c.push("CSME Unconfigure");0"+format("The following actions will be taken: {0}.",c.join(", ")));setDialogMode(11,"Power Actions",3,powerActionDlg,b)}else powerActionDlg()} +function powerActionDlgCheck(){AmtOcrPba=null;AmtOcrPbaLength=0;var b=d5actionSelect.value;if(500==b||501==b)amtstack.RequestOSPowerStateChange(501==b?3:2,function(a,b,c,q){200==q?QH(60,"Power action completed."):QH(60,format("Power action error #{0}.",q));setDialogMode(1,"Power Action",0);setTimeout(function(){setDialogMode(0)},1300)});else if(104==b||105==b)b="Confirm execution of Intel® Remote Secure Erase?
Enter Secure Erase password if required.

Password

WARNING: This will wipe data on the remote system.
", +rsepass=1,setDialogMode(11,"Power Actions",3,powerActionDlg,b);else if(106==b||107==b){var b="Confirm execution of Intel® Remote Platform Erase?

WARNING: This will wipe data on the remote system.
",c=[],a=amtPowerBootCapabilities.PlatformErase;a&2&&c.push("Pyrite Revert");a&4&&c.push("Secure Erase All SSDs");a&64&&c.push("TPM Clear");a&33554432&&c.push("Clear BIOS NVM Variables");a&67108864&&c.push("BIOS Reload of Golden Configuration");a&-2147483648&&c.push("CSME Unconfigure"); +1==c.length?b+="
"+format("The following action will be taken:
  • {0}
",c.join("
  • ")):1"+format("The following actions will be taken:
    • {0}
    ",c.join("
  • ")));setDialogMode(11,"Power Actions",3,powerActionDlg,b)}else powerActionDlg()} function powerActionDlg(){var b=d5actionSelect.value;if(999==b)showAdvPowerDlg();else if(998==b)amtstack.Get("IPS_OptInService",powerActionResponse0,0,1);else{10>b&&2amtversion&&(c=!1);13==currentView&&8==b&&(c=!1);13!=currentView&&10>= b&&(c=!1);c?amtstack.Get("IPS_OptInService",powerActionResponse0,0,1):amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1)}}var AvdPowerDlg; function showAdvPowerDlg(){try{Q("c38").value=2==amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState?10:2}catch(b){}QV("d24dBiosPause",1==amtPowerBootCapabilities.BIOSPause);QV("d24dBiosSecureBoot",1==amtPowerBootCapabilities.BIOSSecureBoot);QV("d24dReflashBios",1==amtPowerBootCapabilities.BIOSReflash);QV("d24dBiosSetup",1==amtPowerBootCapabilities.BIOSSetup);QV("ForceDVDBootOption",1==amtPowerBootCapabilities.ForceCDorDVDBoot);QV("ForceDiagBootOption",1==amtPowerBootCapabilities.ForceDiagnosticBoot);