Now always enabling AMT WIFI and Local WIFI profile sync.

This commit is contained in:
Ylian Saint-Hilaire 2021-03-22 14:27:40 -07:00
parent ed7af83bdc
commit c75e12e027
2 changed files with 88 additions and 76 deletions

View File

@ -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;

View File

@ -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;n<e.length;++n)e[n](c);return c.pkcs1}},
l=a;a=function(b,c){v="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,l.apply(null,Array.prototype.slice.call(arguments,0));a=l;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs1",["require","module","./util","./random","./sha1"],function(){q.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,p,h){return"workers"in p?e(a,b,p,h):d(a,b,p,h)}function d(b,c,e,k){var g=l(b,c),w=0,n=q(g.bitLength());"millerRabinTests"in
e&&(n=e.millerRabinTests);var m=10;"maxBlockTime"in e&&(m=e.maxBlockTime);var u=+new Date;do{g.bitLength()>b&&(g=l(b,c));if(g.isProbablePrime(n))return k(null,g);g.dAddOffset(h[w++%8],0)}while(0>m||+new Date-u<m);a.util.setImmediate(function(){d(b,c,e,k)})}function e(b,c,h,k){function n(){function a(p){if(!h){--e;var n=p.data;if(n.found){for(p=0;p<d.length;++p)d[p].terminate();h=!0;return k(null,new g(n.prime,16))}w.bitLength()>b&&(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<m;++p)d[p]=new Worker(v);for(var e=m,p=0;p<m;++p)d[p].addEventListener("message",a);var h=!1}if("undefined"===typeof Worker)return d(b,c,h,k);var w=l(b,c),m=h.workers,u=h.workLoad||100,q=30*u/8,v=h.workerScript||"forge/prime.worker.js";if(-1===m)return a.util.estimateCores(function(a,b){a&&(b=2);m=b-1;n()});n()}function l(a,b){var c=new g(a,b),d=a-1;c.testBit(d)||c.bitwiseTo(g.ONE.shiftLeft(d),v,c);c.dAddOffset(31-c.mod(u).byteValue(),0);return c}
w.dAddOffset(q,0)}}m=Math.max(1,m);for(var d=[],p=0;p<m;++p)d[p]=new Worker(P);for(var e=m,p=0;p<m;++p)d[p].addEventListener("message",a);var h=!1}if("undefined"===typeof Worker)return d(b,c,h,k);var w=l(b,c),m=h.workers,u=h.workLoad||100,q=30*u/8,P=h.workerScript||"forge/prime.worker.js";if(-1===m)return a.util.estimateCores(function(a,b){a&&(b=2);m=b-1;n()});n()}function l(a,b){var c=new g(a,b),d=a-1;c.testBit(d)||c.bitwiseTo(g.ONE.shiftLeft(d),v,c);c.dAddOffset(31-c.mod(u).byteValue(),0);return c}
function q(a){return 100>=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;c<a.length;++c)a[c]=b.charCodeAt(c)}};if("PRIMEINC"===h.name)return c(b,d,h.options,e);throw Error("Invalid prime generation algorithm: "+h.name);}}}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.prime)return c.prime;c.defined.prime=!0;for(var n=
0;n<e.length;++n)e[n](c);return c.prime}},l=a;a=function(b,c){v="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,l.apply(null,Array.prototype.slice.call(arguments,0));a=l;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/prime",["require","module","./util","./jsbn","./random"],function(){q.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d,e){var h=a.util.createBuffer();d=Math.ceil(d.n.bitLength()/8);if(b.length>d-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<n.length&&(l=m.create(m.Class.UNIVERSAL,m.Type.SET,!0,n));k=[];n=[];null!==c&&(n=a.util.isArray(c)?c:[c]);for(var r=[],u=0;u<n.length;++u){c=n[u];"string"===typeof c&&(c=g.certificateFromPem(c));var q=0===u?l:void 0;c=g.certificateToAsn1(c);c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.certBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.x509Certificate).getBytes()),
m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(c).getBytes())])])]),q]);r.push(c)}0<r.length&&(c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,r),c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(c).getBytes())])]),k.push(c));c=null;null!==b&&(b=g.wrapRsaPrivateKey(g.privateKeyToAsn1(b)),
0<n.length&&(l=m.create(m.Class.UNIVERSAL,m.Type.SET,!0,n));k=[];n=[];null!==c&&(n=a.util.isArray(c)?c:[c]);for(var r=[],q=0;q<n.length;++q){c=n[q];"string"===typeof c&&(c=g.certificateFromPem(c));var u=0===q?l:void 0;c=g.certificateToAsn1(c);c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.certBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.x509Certificate).getBytes()),
m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(c).getBytes())])])]),u]);r.push(c)}0<r.length&&(c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,r),c=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(c).getBytes())])]),k.push(c));c=null;null!==b&&(b=g.wrapRsaPrivateKey(g.privateKeyToAsn1(b)),
c=null===d?m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.keyBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[b]),l]):m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.pkcs8ShroudedKeyBag).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[g.encryptPrivateKeyInfo(b,d,e)]),l]),b=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[c]),b=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,
[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.data).getBytes()),m.create(m.Class.CONTEXT_SPECIFIC,0,!0,[m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,m.toDer(b).getBytes())])]),k.push(b));l=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,k);var y;e.useMac&&(k=a.md.sha1.create(),y=new a.util.ByteBuffer(a.random.getBytes(e.saltSize)),e=e.count,b=h.generateKey(d,y,3,e,20),d=a.hmac.create(),d.start(k,b),d.update(m.toDer(l).getBytes()),d=d.getMac(),y=m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,
!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,m.Type.OID,!1,m.oidToDer(g.oids.sha1).getBytes()),m.create(m.Class.UNIVERSAL,m.Type.NULL,!1,"")]),m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,d.getBytes())]),m.create(m.Class.UNIVERSAL,m.Type.OCTETSTRING,!1,y.getBytes()),m.create(m.Class.UNIVERSAL,m.Type.INTEGER,!1,m.integerToDer(e).getBytes())]));return m.create(m.Class.UNIVERSAL,m.Type.SEQUENCE,!0,[m.create(m.Class.UNIVERSAL,
@ -967,12 +967,12 @@ e+=AddButton("Power Actions...","showPowerActionDlg()")+" ";e+=AddButton("Save S
d=d+"<br><h2>General Settings</h2>"+TableStart();e="";"<i>None</i>"!=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+="<br><h2>"+(amtwirelessif==a?"Wireless Interface":"Wired Interface")+"</h2>";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:"<i>None</i>")));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&&5<amtversion){c=
amtsysstate.IPS_IPv6PortSettings.responses[a];for(var p="Disabled",A,e=amtsysstate.CIM_ElementSettingData.responses,k=0;k<e.length;k++)e[k].SettingData&&e[k].SettingData.ReferenceParameters.SelectorSet.Selector.Value=="Intel(r) IPS IPv6 Settings "+a&&(A=1==e[k].IsCurrent);1==A&&(p=(e=isIpAddress(c.IPv6Address)||isIpAddress(c.DefaultRouter)||isIpAddress(c.PrimaryDNS)||isIpAddress(c.SecondaryDNS))?"Enabled, Automatic & manual addresses":"Enabled, Automatic addresses");d+=TableEntry("IPv6 state",addLinkConditional(p,
"showIPv6StateDlg("+a+","+A+")",xxAccountAdminName));if(1==A){if(c.CurrentAddressInfo&&0<c.CurrentAddressInfo.length){c.CurrentAddressInfo=MakeToArray(c.CurrentAddressInfo);ipv6addr="";for(k=0;k<c.CurrentAddressInfo.length;k++)0<ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=c.CurrentAddressInfo[k].split(",")[0];d+=TableEntry("IPv6 address",addLink(ipv6addr,"showIPv6AddrDlg("+a+',"'+c.CurrentAddressInfo+'")'))}else d+=TableEntry("IPv6 address","None");isIpAddress(c.CurrentDefaultRouter)&&(d+=TableEntry("IPv6 default router",
c.CurrentDefaultRouter));isIpAddress(c.CurrentPrimaryDNS)&&(e=c.CurrentPrimaryDNS,isIpAddress(c.CurrentSecondaryDNS)&&(e+=" / "+c.CurrentSecondaryDNS),d+=TableEntry("IPv6 domain name server",e))}}d+=TableEnd()}}1!=urlvars.kvmonly&&0==fullscreenonly&&(-1!=amtwirelessif&&0==(amtFirstPull&2)&&PullWireless(),QH(19,d),1==b&&0==(amtFirstPull&4)&&PullSystemDefense(),0==(amtFirstPull&8)&&(11<amtversion||11==amtversion&&5<amtversionmin)&&PullStorage());0==currentView&&go(1,1)}}
function isIpAddress(b,c){return b&&null!=b&&0<b.length&&"::"!=b&&"::0"!=b?b:c}
"showWifiStateDlg()",xxAccountAdminName)),s=xxWireless.CIM_WiFiEndpoint.response.LANID,d+=TableEntry("Radio State",xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"<i>None</i>")),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&&5<amtversion){c=amtsysstate.IPS_IPv6PortSettings.responses[a];for(var p="Disabled",A,e=amtsysstate.CIM_ElementSettingData.responses,k=0;k<e.length;k++)e[k].SettingData&&
e[k].SettingData.ReferenceParameters.SelectorSet.Selector.Value=="Intel(r) IPS IPv6 Settings "+a&&(A=1==e[k].IsCurrent);1==A&&(p=(e=isIpAddress(c.IPv6Address)||isIpAddress(c.DefaultRouter)||isIpAddress(c.PrimaryDNS)||isIpAddress(c.SecondaryDNS))?"Enabled, Automatic & manual addresses":"Enabled, Automatic addresses");d+=TableEntry("IPv6 state",addLinkConditional(p,"showIPv6StateDlg("+a+","+A+")",xxAccountAdminName));if(1==A){if(c.CurrentAddressInfo&&0<c.CurrentAddressInfo.length){c.CurrentAddressInfo=
MakeToArray(c.CurrentAddressInfo);ipv6addr="";for(k=0;k<c.CurrentAddressInfo.length;k++)0<ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=c.CurrentAddressInfo[k].split(",")[0];d+=TableEntry("IPv6 address",addLink(ipv6addr,"showIPv6AddrDlg("+a+',"'+c.CurrentAddressInfo+'")'))}else d+=TableEntry("IPv6 address","None");isIpAddress(c.CurrentDefaultRouter)&&(d+=TableEntry("IPv6 default router",c.CurrentDefaultRouter));isIpAddress(c.CurrentPrimaryDNS)&&(e=c.CurrentPrimaryDNS,isIpAddress(c.CurrentSecondaryDNS)&&
(e+=" / "+c.CurrentSecondaryDNS),d+=TableEntry("IPv6 domain name server",e))}}d+=TableEnd()}}1!=urlvars.kvmonly&&0==fullscreenonly&&(-1!=amtwirelessif&&0==(amtFirstPull&2)&&PullWireless(),QH(19,d),1==b&&0==(amtFirstPull&4)&&PullSystemDefense(),0==(amtFirstPull&8)&&(11<amtversion||11==amtversion&&5<amtversionmin)&&PullStorage());0==currentView&&go(1,1)}}function isIpAddress(b,c){return b&&null!=b&&0<b.length&&"::"!=b&&"::0"!=b?b:c}
function showLinkPolicyDlg(b){if(!xxdialogMode){var c=amtsysstate.AMT_EthernetPortSettings.responses[b],a;a=""+("<label><input type=checkbox id=d11p1 value=1 "+(0<=c.LinkPolicy.indexOf(1)?"checked":"")+">Available in S0/AC - Powered on & plugged in</label><br>");a+="<label><input type=checkbox id=d11p2 value=14 "+(0<=c.LinkPolicy.indexOf(14)?"checked":"")+">Available in Sx/AC - Sleeping & plugged in</label><br>";a+="<label><input type=checkbox id=d11p3 value=16 "+(0<=c.LinkPolicy.indexOf(16)?"checked":
"")+">Available in S0/DC - Powered on & on battery</label><br>";a+="<label><input type=checkbox id=d11p4 value=224 "+(0<=c.LinkPolicy.indexOf(224)?"checked":"")+">Available in Sx/DC - Sleeping & on battery</label><br>";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="<br><h2>Wireless Profiles</h2>"+TableStart2();e+="<tr><td class=r2 style=padding-left:15px><br>Wireless profiles that Intel&reg; AMT will use for network connectivity.<br><br>";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+="<div class=itemBar onclick=showWifiDetails("+
c+")><div style=float:right>"+EscapeHtml(d.SSID)+", "+xxWifiAuthenticationMethod[d.AuthenticationMethod]+", "+xxWifiEncryptionMethod[d.EncryptionMethod]+" &nbsp; ",xxAccountAdminName&&(e+=AddButton2("Remove",'wifiRemoveButton("'+c+'")')),e+="</div><div style=padding-top:3px><b>"+EscapeHtml(d.ElementName)+"</b></div></div>",a++);0==a&&(e+="<i>No Wireless Profiles Present</i><br>");e+="<br><td class=r2>";e=xxAccountAdminName?e+TableEnd(AddButton("New Profile","showWifiNewProfile()")):e+TableEnd("");
QH(20,e+"<br>")}}}function showWifiStateDlg(){if(!xxdialogMode){var b="",c;for(c in xxWifiState)b+="<label><input type=radio name=d11 id=wl"+c+" value="+c+" "+(xxWireless.CIM_WiFiPort.response.EnabledState==c?"checked":"")+">"+xxWifiState[c]+"</label><br>";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=""+("<label><input type=radio name=d11 id=wl0 value=0 "+(0==xxWireless.AMT_WiFiPortConfigurationService.response.localProfileSynchronizationEnabled?"checked":"")+">Disabled</label><br>");b+="<label><input type=radio name=d11 id=wl0 value=1 "+(1==xxWireless.AMT_WiFiPortConfigurationService.response.localProfileSynchronizationEnabled?"checked":"")+">Enabled</label><br>";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="<div style=text-align:left>"+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+"</div>")}}
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));9<amtversion&&b&1&&(addOption("d5actionSelect","OS Wake from Standby",500),addOption("d5actionSelect","OS Power Saving",501),addOption("d5actionSelect","Soft-off",12),addOption("d5actionSelect","Soft-reset",14),addOption("d5actionSelect","Sleep",4),addOption("d5actionSelect","Hibernate",7));1==amtPowerBootCapabilities.BIOSSetup&&(b&2&&addOption("d5actionSelect","Power up to BIOS",100),b&1&&addOption("d5actionSelect","Reset to BIOS",101));1==amtPowerBootCapabilities.SecureErase&&
(b&2&&addOption("d5actionSelect","Power up to Secure Erase",104),b&1&&addOption("d5actionSelect","Reset to Secure Erase",105));null!=amtPowerBootCapabilities.PlatformErase&&0!=(amtPowerBootCapabilities.PlatformErase&1)&&(b&2&&addOption("d5actionSelect","Power up to Platform Erase",106),b&1&&addOption("d5actionSelect","Reset to Platform Erase",107));b&1&&addOption("d5actionSelect","Reset to IDE-R Floppy",200);b&2&&addOption("d5actionSelect","Power on to IDE-R Floppy",201);b&1&&addOption("d5actionSelect",
"Reset to IDE-R CDROM",202);b&2&&addOption("d5actionSelect","Power on to IDE-R CDROM",203);b&1&&addOption("d5actionSelect","Reset to PXE",400);b&2&&addOption("d5actionSelect","Power on to PXE",401);addOption("d5actionSelect","Custom action...",999);5<amtversion&&addOption("d5actionSelect","User consent...",998);setDialogMode(5,"Power Actions",3,powerActionDlgCheck)}else messagebox("Power Action",format("Unable to get system capabilities, error {0}",d))}
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,v){200==v?QH(60,"Power action completed."):QH(60,format("Power action error #{0}.",v));setDialogMode(1,"Power Action",0);setTimeout(function(){setDialogMode(0)},1300)});else if(104==b||105==b)b="Confirm execution of Intel&reg; Remote Secure Erase?<br>Enter Secure Erase password if required.<br><br><div style=height:16px><input type=password id=rsepass maxlength=32 style=float:right;width:240px><div>Password</div></div><br><div style=color:red><b>WARNING:</b> This will wipe data on the remote system.</div>",
rsepass=1,setDialogMode(11,"Power Actions",3,powerActionDlg,b);else if(106==b||107==b){var b="Confirm execution of Intel&reg; Remote Platform Erase?<br><br><div style=color:red><b>WARNING:</b> This will wipe data on the remote system.</div>",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<c.length&&(b+="<br>"+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&reg; Remote Secure Erase?<br>Enter Secure Erase password if required.<br><br><div style=height:16px><input type=password id=rsepass maxlength=32 style=float:right;width:240px><div>Password</div></div><br><div style=color:red><b>WARNING:</b> This will wipe data on the remote system.</div>",
rsepass=1,setDialogMode(11,"Power Actions",3,powerActionDlg,b);else if(106==b||107==b){var b="Confirm execution of Intel&reg; Remote Platform Erase?<br><br><div style=color:red><b>WARNING:</b> This will wipe data on the remote system.</div>",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+="<br>"+format("The following action will be taken:<ul><li>{0}</li></ul>",c.join("</li><li>")):1<c.length&&(b+="<br>"+format("The following actions will be taken:<ul><li>{0}</li></ul>",c.join("</li><li>")));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&&2<b&&null==urlvars.noredirdisconnect&&(3==desktop.State&&connectDesktop(),3==terminal.State&&connectTerminal(),void 0!=ider&&3==ider.state&&iderStop());statusbox("Power Action","Checking state...");null!=rsepass&&1===rsepass&&(rsepass=Q("rsepass").value);var c=!0;6>amtversion&&(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);