mirror of
https://github.com/Ylianst/MeshCommander
synced 2025-12-06 06:03:20 +00:00
Can now set WIFI 802.1x certificates.
This commit is contained in:
38
amt-0.2.0.js
38
amt-0.2.0.js
@@ -962,15 +962,14 @@ args = {
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
function execArgumentsToXml(args) {
|
function execArgumentsToXml(args) {
|
||||||
if(args === undefined || args === null) return null;
|
if ((args === undefined) || (args === null)) return null;
|
||||||
|
|
||||||
var result = '';
|
var result = '';
|
||||||
for(var argName in args) {
|
for (var argName in args) {
|
||||||
var arg = args[argName];
|
var arg = args[argName];
|
||||||
if(!arg) continue;
|
if (!arg) continue;
|
||||||
if(arg['__parameterType'] === 'reference') result += referenceToXml(argName, arg);
|
if (arg['__parameterType'] === 'reference') { result += referenceToXml(argName, arg); }
|
||||||
else result += instanceToXml(argName, arg);
|
else { result += instanceToXml(argName, arg); }
|
||||||
//if(arg['__isInstance']) result += instanceToXml(argName, arg);
|
//if (arg['__isInstance']) result += instanceToXml(argName, arg);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -988,25 +987,28 @@ function execArgumentsToXml(args) {
|
|||||||
</r:WiFiEndpointSettingsInput>
|
</r:WiFiEndpointSettingsInput>
|
||||||
*/
|
*/
|
||||||
function instanceToXml(instanceName, inInstance) {
|
function instanceToXml(instanceName, inInstance) {
|
||||||
if(inInstance === undefined || inInstance === null) return null;
|
if (inInstance === undefined || inInstance === null) return null;
|
||||||
|
|
||||||
var hasNamespace = !!inInstance['__namespace'];
|
var hasNamespace = !!inInstance['__namespace'];
|
||||||
var startTag = hasNamespace ? '<q:' : '<';
|
var startTag = hasNamespace ? '<q:' : '<';
|
||||||
var endTag = hasNamespace ? '</q:' : '</';
|
var endTag = hasNamespace ? '</q:' : '</';
|
||||||
var namespaceDef = hasNamespace ? (' xmlns:q="' + inInstance['__namespace'] + '"' ): '';
|
var namespaceDef = hasNamespace ? (' xmlns:q="' + inInstance['__namespace'] + '"' ): '';
|
||||||
var result = '<r:' + instanceName + namespaceDef + '>';
|
var result = '<r:' + instanceName + namespaceDef + '>';
|
||||||
for(var prop in inInstance) {
|
if (typeof inInstance == 'string') {
|
||||||
if (!inInstance.hasOwnProperty(prop) || prop.indexOf('__') === 0) continue;
|
result += inInstance;
|
||||||
|
} else {
|
||||||
|
for (var prop in inInstance) {
|
||||||
|
if (!inInstance.hasOwnProperty(prop) || prop.indexOf('__') === 0) continue;
|
||||||
|
|
||||||
if (typeof inInstance[prop] === 'function' || Array.isArray(inInstance[prop]) ) continue;
|
if (typeof inInstance[prop] === 'function' || Array.isArray(inInstance[prop])) continue;
|
||||||
|
|
||||||
if (typeof inInstance[prop] === 'object') {
|
if (typeof inInstance[prop] === 'object') {
|
||||||
//result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>';
|
//result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>';
|
||||||
console.error('only convert one level down...');
|
console.error('only convert one level down...');
|
||||||
}
|
} else {
|
||||||
else {
|
result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>';
|
||||||
result += startTag + prop +'>' + inInstance[prop].toString() + endTag + prop +'>';
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += '</r:' + instanceName + '>';
|
result += '</r:' + instanceName + '>';
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
28
index.html
28
index.html
@@ -7783,7 +7783,23 @@
|
|||||||
|
|
||||||
function removeWifiEntryResponse(stack, name, response, status, tag) {
|
function removeWifiEntryResponse(stack, name, response, status, tag) {
|
||||||
if (methodcheck(response)) return;
|
if (methodcheck(response)) return;
|
||||||
amtstack.Enum('CIM_WiFiEndpointSettings', function(stack, name, responses, status) { if (status == 200) { xxWireless['CIM_WiFiEndpointSettings'].responses = responses; showWirelessInfo(); } } );
|
// ###BEGIN###{!NetAuth}
|
||||||
|
amtstack.BatchEnum('', ['CIM_WiFiEndpointSettings'], function (stack, name, responses, status) {
|
||||||
|
if (status == 200) {
|
||||||
|
xxWireless['CIM_WiFiEndpointSettings'].responses = responses['CIM_WiFiEndpointSettings'].responses;
|
||||||
|
showWirelessInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// ###END###{!NetAuth}
|
||||||
|
// ###BEGIN###{NetAuth}
|
||||||
|
amtstack.BatchEnum('', ['CIM_WiFiEndpointSettings', 'CIM_IEEE8021xSettings'], function (stack, name, responses, status) {
|
||||||
|
if (status == 200) {
|
||||||
|
xxWireless['CIM_WiFiEndpointSettings'].responses = responses['CIM_WiFiEndpointSettings'].responses;
|
||||||
|
xxWireless['CIM_IEEE8021xSettings'].responses = responses['CIM_IEEE8021xSettings'].responses;
|
||||||
|
showWirelessInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// ###END###{NetAuth}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showWifiNewProfile() {
|
function showWifiNewProfile() {
|
||||||
@@ -7858,14 +7874,8 @@
|
|||||||
if (Q('idx_d12password').value != '') { sc['Password'] = Q('idx_d12password').value; }
|
if (Q('idx_d12password').value != '') { sc['Password'] = Q('idx_d12password').value; }
|
||||||
if (Q('idx_d12domain').value != '') { sc['Domain'] = Q('idx_d12domain').value; }
|
if (Q('idx_d12domain').value != '') { sc['Domain'] = Q('idx_d12domain').value; }
|
||||||
if (Q('idx_d12protocol').value > 3) { sc['ProtectedAccessCredential'] = Q('idx_d12pac').value; sc['PACPassword'] = Q('idx_d12pacpassword').value; }
|
if (Q('idx_d12protocol').value > 3) { sc['ProtectedAccessCredential'] = Q('idx_d12pac').value; sc['PACPassword'] = Q('idx_d12pacpassword').value; }
|
||||||
if (parseInt(Q('idx_d12clientcert').value) >= 0) {
|
if (parseInt(Q('idx_d12clientcert').value) >= 0) { 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">' + xxCertificates[parseInt(Q('idx_d12clientcert').value)]['InstanceID'] + '</Selector></SelectorSet></ReferenceParameters>'; }
|
||||||
// TODO: DOES NOT WORK
|
if (parseInt(Q('idx_d12servercert').value) >= 0) { 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">' + xxCertificates[parseInt(Q('idx_d12servercert').value)]['InstanceID'] + '</Selector></SelectorSet></ReferenceParameters>'; }
|
||||||
netAuthSettingsClientCert = '<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>' + amtstack.CompleteName('AMT_PublicKeyCertificate') + '</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">' + xxCertificates[parseInt(Q('idx_d12clientcert').value)]['InstanceID'] + '</w:Selector></w:SelectorSet></a:ReferenceParameters>';
|
|
||||||
}
|
|
||||||
if (parseInt(Q('idx_d12servercert').value) >= 0) {
|
|
||||||
// TODO: DOES NOT WORK
|
|
||||||
netAuthSettingsServerCaCert = '<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>' + amtstack.CompleteName('AMT_PublicKeyCertificate') + '</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">' + xxCertificates[parseInt(Q('idx_d12servercert').value)]['InstanceID'] + '</w:Selector></w:SelectorSet></a:ReferenceParameters>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// ###END###{NetAuth}
|
// ###END###{NetAuth}
|
||||||
amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(
|
amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(
|
||||||
|
|||||||
Reference in New Issue
Block a user