MeshCMD fixes.

This commit is contained in:
Ylian Saint-Hilaire 2019-06-27 16:14:14 -07:00
parent 86fc328325
commit a8f69cdf8f
4 changed files with 10 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@ -982,6 +982,8 @@ function activeToACMEx(fwNonce, dnsSuffix, digestRealm, uuid, allowedModes) {
if (typeof cmd.password != 'string') { console.log('Invalid server password'); exit(100); return; } if (typeof cmd.password != 'string') { console.log('Invalid server password'); exit(100); return; }
if (typeof cmd.nonce != 'string') { console.log('Invalid server nonce'); exit(100); return; } if (typeof cmd.nonce != 'string') { console.log('Invalid server nonce'); exit(100); return; }
if (typeof cmd.certs != 'object') { console.log('Invalid server certificates'); exit(100); return; } if (typeof cmd.certs != 'object') { console.log('Invalid server certificates'); exit(100); return; }
settings.xxprofileScript = cmd.profileScript;
settings.xxrawpassword = cmd.rawpassword;
cmd.index = 0; cmd.index = 0;
// If we are in CCM mode, deactivate. // If we are in CCM mode, deactivate.
@ -1078,10 +1080,10 @@ function AcmActivationCompleted(result) {
settings.xxsocket.end(); settings.xxsocket.end();
exit(1); exit(1);
} else { } else {
if ((cmd.profileScript !== null) && (cmd.rawpassword != null)) { if ((settings.xxprofileScript !== null) && (settings.xxrawpassword != null)) {
console.log('Intel AMT ACM activation success, applying profile...'); console.log('Intel AMT ACM activation success, applying profile...');
settings.scriptjson = cmd.profileScript; settings.scriptjson = settings.xxprofileScript;
settings.password = cmd.rawpassword; // This is only going to work if the server sends the raw password settings.password = settings.xxrawpassword; // This is only going to work if the server sends the raw password
settings.username = 'admin'; settings.username = 'admin';
startMeScriptEx(function () { console.log('Intel AMT profile applied.'); settings.xxsocket.end(); exit(0); }, stack); startMeScriptEx(function () { console.log('Intel AMT profile applied.'); settings.xxsocket.end(); exit(0); }, stack);
} else { } else {

View File

@ -982,6 +982,8 @@ function activeToACMEx(fwNonce, dnsSuffix, digestRealm, uuid, allowedModes) {
if (typeof cmd.password != 'string') { console.log('Invalid server password'); exit(100); return; } if (typeof cmd.password != 'string') { console.log('Invalid server password'); exit(100); return; }
if (typeof cmd.nonce != 'string') { console.log('Invalid server nonce'); exit(100); return; } if (typeof cmd.nonce != 'string') { console.log('Invalid server nonce'); exit(100); return; }
if (typeof cmd.certs != 'object') { console.log('Invalid server certificates'); exit(100); return; } if (typeof cmd.certs != 'object') { console.log('Invalid server certificates'); exit(100); return; }
settings.xxprofileScript = cmd.profileScript;
settings.xxrawpassword = cmd.rawpassword;
cmd.index = 0; cmd.index = 0;
// If we are in CCM mode, deactivate. // If we are in CCM mode, deactivate.
@ -1078,10 +1080,10 @@ function AcmActivationCompleted(result) {
settings.xxsocket.end(); settings.xxsocket.end();
exit(1); exit(1);
} else { } else {
if ((cmd.profileScript !== null) && (cmd.rawpassword != null)) { if ((settings.xxprofileScript !== null) && (settings.xxrawpassword != null)) {
console.log('Intel AMT ACM activation success, applying profile...'); console.log('Intel AMT ACM activation success, applying profile...');
settings.scriptjson = cmd.profileScript; settings.scriptjson = settings.xxprofileScript;
settings.password = cmd.rawpassword; // This is only going to work if the server sends the raw password settings.password = settings.xxrawpassword; // This is only going to work if the server sends the raw password
settings.username = 'admin'; settings.username = 'admin';
startMeScriptEx(function () { console.log('Intel AMT profile applied.'); settings.xxsocket.end(); exit(0); }, stack); startMeScriptEx(function () { console.log('Intel AMT profile applied.'); settings.xxsocket.end(); exit(0); }, stack);
} else { } else {