From 5ba4636b9eaf3af8e23672cb861ccc7015a796b0 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 15 Sep 2022 01:21:44 -0700 Subject: [PATCH] Added SMBIOS field 131 as AMT verification fallback if 130 is undefined --- agents/modules_meshcmd/smbios.js | 17 ++++++++++++++--- agents/modules_meshcore/smbios.js | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/agents/modules_meshcmd/smbios.js b/agents/modules_meshcmd/smbios.js index b149e907..2391b8e9 100644 --- a/agents/modules_meshcmd/smbios.js +++ b/agents/modules_meshcmd/smbios.js @@ -269,15 +269,18 @@ function SMBiosTables() this.amtInfo = function amtInfo(data) { if (!data) { throw ('no data'); } var retVal = { AMT: false }; - if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') { + if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') + { var amt = data[130].peek(); retVal.AMT = amt[4] ? true : false; - if (retVal.AMT) { + if (retVal.AMT) + { retVal.enabled = amt[5] ? true : false; retVal.storageRedirection = amt[6] ? true : false; retVal.serialOverLan = amt[7] ? true : false; retVal.kvm = amt[14] ? true : false; - if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') { + if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') + { var settings = data[131].peek(); if (settings[0] & 0x04) { retVal.TXT = (settings[0] & 0x08) ? true : false; } if (settings[0] & 0x10) { retVal.VMX = (settings[0] & 0x20) ? true : false; } @@ -295,6 +298,14 @@ function SMBiosTables() } } } + if (!retVal.AMT) + { + if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') + { + var settings = data[131].peek(); + if ((settings[20] & 0x08) == 0x08) { retVal.AMT = true; } + } + } return (retVal); }; this.smTableTypes = { diff --git a/agents/modules_meshcore/smbios.js b/agents/modules_meshcore/smbios.js index b149e907..2391b8e9 100644 --- a/agents/modules_meshcore/smbios.js +++ b/agents/modules_meshcore/smbios.js @@ -269,15 +269,18 @@ function SMBiosTables() this.amtInfo = function amtInfo(data) { if (!data) { throw ('no data'); } var retVal = { AMT: false }; - if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') { + if (data[130] && data[130].peek().slice(0, 4).toString() == '$AMT') + { var amt = data[130].peek(); retVal.AMT = amt[4] ? true : false; - if (retVal.AMT) { + if (retVal.AMT) + { retVal.enabled = amt[5] ? true : false; retVal.storageRedirection = amt[6] ? true : false; retVal.serialOverLan = amt[7] ? true : false; retVal.kvm = amt[14] ? true : false; - if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') { + if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') + { var settings = data[131].peek(); if (settings[0] & 0x04) { retVal.TXT = (settings[0] & 0x08) ? true : false; } if (settings[0] & 0x10) { retVal.VMX = (settings[0] & 0x20) ? true : false; } @@ -295,6 +298,14 @@ function SMBiosTables() } } } + if (!retVal.AMT) + { + if (data[131].peek() && data[131].peek().slice(52, 56).toString() == 'vPro') + { + var settings = data[131].peek(); + if ((settings[20] & 0x08) == 0x08) { retVal.AMT = true; } + } + } return (retVal); }; this.smTableTypes = {