Made use of AMT user/pass provided by MeshCMD in amtconfig.
Ylian Saint-Hilaire committed
Jul 14, 2021 at 08:30 UTC
ab85ec9a3d65d3372e115b36af7920be83c77779
2 files changed
+11
-6
amtmanager.js
+7
-2
@@ -458,8 +458,13 @@ module.exports.CreateAmtManager = function (parent) {
458
if (dev.acctry == null) {
459
dev.acctry = [];
460
461
+ // Add Intel AMT username and password provided by MeshCMD if available
462
+ if ((dev.mpsConnection != null) && (dev.mpsConnection.tag != null) && (dev.mpsConnection.tag.meiState != null) && (typeof dev.mpsConnection.tag.meiState.amtuser == 'string') && (typeof dev.mpsConnection.tag.meiState.amtpass == 'string') && (dev.mpsConnection.tag.meiState.amtuser != '') && (dev.mpsConnection.tag.meiState.amtpass != '')) {
463
+ dev.acctry.push([dev.mpsConnection.tag.meiState.amtuser, dev.mpsConnection.tag.meiState.amtpass]);
464
+ }
465
+
466
// Add the know Intel AMT password for this device if available
462
- if ((typeof dev.intelamt.user == 'string') && (typeof dev.intelamt.pass == 'string')) { dev.acctry.push([dev.intelamt.user, dev.intelamt.pass]); }
467
+ if ((typeof dev.intelamt.user == 'string') && (typeof dev.intelamt.pass == 'string') && (dev.intelamt.user != '') && (dev.intelamt.pass != '')) { dev.acctry.push([dev.intelamt.user, dev.intelamt.pass]); }
468
469
// Add the policy password as an alternative
470
if ((typeof dev.policy.password == 'string') && (dev.policy.password != '')) { dev.acctry.push(['admin', dev.policy.password]); }
@@ -669,7 +674,7 @@ module.exports.CreateAmtManager = function (parent) {
674
}
675
}
676
672
- // If this devics is in CCM mode and we have a bad password reset policy, do it now.
677
+ // If this device is in CCM mode and we have a bad password reset policy, do it now.
678
if ((dev.connType == 2) && (dev.policy.badPass == 1) && (dev.mpsConnection != null) && (dev.mpsConnection.tag != null) && (dev.mpsConnection.tag.meiState != null) && (dev.mpsConnection.tag.meiState.Flags != null) && ((dev.mpsConnection.tag.meiState.Flags & 2) != 0)) {
679
deactivateIntelAmtCCM(dev);
680
return;
mpsserver.js
+4
-4
@@ -600,8 +600,8 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
600
}
601
if (obj.parent.webserver.meshes[cookie.m] == null) {
602
meshNotFoundCount++;
603
- socket.ControlMsg({ action: 'console', msg: 'Device group not found' });
604
- parent.debug('mps', 'Device group not found', username, password);
603
+ socket.ControlMsg({ action: 'console', msg: 'Device group not found (1)' });
604
+ parent.debug('mps', 'Device group not found (1)', username, password);
605
SendUserAuthFail(socket);
606
return -1;
607
}
@@ -645,8 +645,8 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
645
}
646
if (mesh == null) {
647
meshNotFoundCount++;
648
- socket.ControlMsg({ action: 'console', msg: 'Device group not found' });
649
- parent.debug('mps', 'Device group not found', username, password);
648
+ socket.ControlMsg({ action: 'console', msg: 'Device group not found (2)' });
649
+ parent.debug('mps', 'Device group not found (2)', username, password);
650
SendUserAuthFail(socket);
651
return -1;
652
}