From c7d4d83e791778a8bc9cc5c7575813b4fc463b06 Mon Sep 17 00:00:00 2001 From: Chris Thornton Date: Mon, 4 Apr 2022 13:06:37 -0700 Subject: [PATCH 1/9] Switch `Buffer.from` to use `new Buffer` when used on arrays Buffer.from when used on arrays of integers returns `null` when running with meshagent (at least on linux, not sure if this happens elsewhere). This allows for meshcmd amtider to actually start, since otherwise the connection is just left hanging --- agents/modules_meshcmd/amt-ider.js | 82 ++++++++++++------------- agents/modules_meshcmd/amt-redir-duk.js | 14 ++--- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/agents/modules_meshcmd/amt-ider.js b/agents/modules_meshcmd/amt-ider.js index dd6f8205..0c00a72d 100644 --- a/agents/modules_meshcmd/amt-ider.js +++ b/agents/modules_meshcmd/amt-ider.js @@ -30,32 +30,32 @@ module.exports = function CreateAmtRemoteIder() { obj.debug = false; // Mode Sense - var IDE_ModeSence_LS120Disk_Page_Array = Buffer.from([0x00, 0x26, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x10, 0xA9, 0x08, 0x20, 0x02, 0x00, 0x03, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00]); - var IDE_ModeSence_3F_LS120_Array = Buffer.from([0x00, 0x5c, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x16, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x10, 0xA9, 0x08, 0x20, 0x02, 0x00, 0x03, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x11, 0x24, 0x31]); - var IDE_ModeSence_FloppyDisk_Page_Array = Buffer.from([0x00, 0x26, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x04, 0xB0, 0x02, 0x12, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00]); - var IDE_ModeSence_3F_Floppy_Array = Buffer.from([0x00, 0x5c, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x16, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x05, 0x1e, 0x04, 0xb0, 0x02, 0x12, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xd0, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x11, 0x24, 0x31]); - var IDE_ModeSence_CD_1A_Array = Buffer.from([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); - //var IDE_ModeSence_CD_1B_Array = Buffer.from([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); - var IDE_ModeSence_CD_1D_Array = Buffer.from([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); - var IDE_ModeSence_CD_2A_Array = Buffer.from([0x00, 0x20, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); - //var IDE_ModeSence_CD_01_Array = Buffer.from([0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00]); - var IDE_ModeSence_3F_CD_Array = Buffer.from([0x00, 0x28, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + var IDE_ModeSence_LS120Disk_Page_Array = new Buffer([0x00, 0x26, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x10, 0xA9, 0x08, 0x20, 0x02, 0x00, 0x03, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00]); + var IDE_ModeSence_3F_LS120_Array = new Buffer([0x00, 0x5c, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x16, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x10, 0xA9, 0x08, 0x20, 0x02, 0x00, 0x03, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x11, 0x24, 0x31]); + var IDE_ModeSence_FloppyDisk_Page_Array = new Buffer([0x00, 0x26, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x04, 0xB0, 0x02, 0x12, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xD0, 0x00, 0x00]); + var IDE_ModeSence_3F_Floppy_Array = new Buffer([0x00, 0x5c, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x16, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x05, 0x1e, 0x04, 0xb0, 0x02, 0x12, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xd0, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x11, 0x24, 0x31]); + var IDE_ModeSence_CD_1A_Array = new Buffer([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + //var IDE_ModeSence_CD_1B_Array = new Buffer([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + var IDE_ModeSence_CD_1D_Array = new Buffer([0x00, 0x12, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + var IDE_ModeSence_CD_2A_Array = new Buffer([0x00, 0x20, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + //var IDE_ModeSence_CD_01_Array = new Buffer([0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00]); + var IDE_ModeSence_3F_CD_Array = new Buffer([0x00, 0x28, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); // 0x46 constant data - var IDE_CD_ConfigArrayHeader = Buffer.from([0x00, 0x00,0x00, 0x28, 0x00, 0x00, 0x00, 0x08]); - var IDE_CD_ConfigArrayProfileList = Buffer.from([0x00, 0x00, 0x03, 0x04, 0x00, 0x08, 0x01, 0x00]); - var IDE_CD_ConfigArrayCore = Buffer.from([0x00, 0x01, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02]); - var IDE_CD_Morphing = Buffer.from([0x00, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00]); - var IDE_CD_ConfigArrayRemovable = Buffer.from([0x00, 0x03, 0x03, 0x04, 0x29, 0x00, 0x00, 0x02]); - var IDE_CD_ConfigArrayRandom = Buffer.from([0x00, 0x10, 0x01, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00]); - var IDE_CD_Read = Buffer.from([0x00, 0x1E, 0x03, 0x00]); - var IDE_CD_PowerManagement = Buffer.from([0x01, 0x00, 0x03, 0x00]); - var IDE_CD_Timeout = Buffer.from([0x01, 0x05, 0x03, 0x00]); + var IDE_CD_ConfigArrayHeader = new Buffer([0x00, 0x00,0x00, 0x28, 0x00, 0x00, 0x00, 0x08]); + var IDE_CD_ConfigArrayProfileList = new Buffer([0x00, 0x00, 0x03, 0x04, 0x00, 0x08, 0x01, 0x00]); + var IDE_CD_ConfigArrayCore = new Buffer([0x00, 0x01, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02]); + var IDE_CD_Morphing = new Buffer([0x00, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00]); + var IDE_CD_ConfigArrayRemovable = new Buffer([0x00, 0x03, 0x03, 0x04, 0x29, 0x00, 0x00, 0x02]); + var IDE_CD_ConfigArrayRandom = new Buffer([0x00, 0x10, 0x01, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00]); + var IDE_CD_Read = new Buffer([0x00, 0x1E, 0x03, 0x00]); + var IDE_CD_PowerManagement = new Buffer([0x01, 0x00, 0x03, 0x00]); + var IDE_CD_Timeout = new Buffer([0x01, 0x05, 0x03, 0x00]); // 0x01 constant data - var IDE_ModeSence_FloppyError_Recovery_Array = Buffer.from([0x00, 0x12, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]); - var IDE_ModeSence_Ls120Error_Recovery_Array = Buffer.from([0x00, 0x12, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]); - var IDE_ModeSence_CDError_Recovery_Array = Buffer.from([0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00]); + var IDE_ModeSence_FloppyError_Recovery_Array = new Buffer([0x00, 0x12, 0x24, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]); + var IDE_ModeSence_Ls120Error_Recovery_Array = new Buffer([0x00, 0x12, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]); + var IDE_ModeSence_CDError_Recovery_Array = new Buffer([0x00, 0x0E, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00]); // Private method, called by parent when it change state @@ -125,28 +125,28 @@ module.exports = function CreateAmtRemoteIder() { // CommandEndResponse (SCSI_SENSE) obj.SendCommandEndResponse = function (error, sense, device, asc, asq) { - if (error) { obj.SendCommand(0x51, Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc5, 0, 3, 0, 0, 0, device, 0x50, 0, 0, 0]), true); } - else { obj.SendCommand(0x51, Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x87, (sense << 4), 3, 0, 0, 0, device, 0x51, sense, asc, asq]), true); } + if (error) { obj.SendCommand(0x51, new Buffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc5, 0, 3, 0, 0, 0, device, 0x50, 0, 0, 0]), true); } + else { obj.SendCommand(0x51, new Buffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x87, (sense << 4), 3, 0, 0, 0, device, 0x51, sense, asc, asq]), true); } } // DataToHost (SCSI_READ) obj.SendDataToHost = function (device, completed, data, dma) { var dmalen = (dma) ? 0 : data.length; if (completed == true) { - obj.SendCommand(0x54, Buffer.concat([Buffer.from([0, (data.length & 0xff), (data.length >> 8), 0, dma ? 0xb4 : 0xb5, 0, 2, 0, (dmalen & 0xff), (dmalen >> 8), device, 0x58, 0x85, 0, 3, 0, 0, 0, device, 0x50, 0, 0, 0, 0, 0, 0]), data ]), completed, dma); + obj.SendCommand(0x54, Buffer.concat([new Buffer([0, (data.length & 0xff), (data.length >> 8), 0, dma ? 0xb4 : 0xb5, 0, 2, 0, (dmalen & 0xff), (dmalen >> 8), device, 0x58, 0x85, 0, 3, 0, 0, 0, device, 0x50, 0, 0, 0, 0, 0, 0]), data ]), completed, dma); } else { - obj.SendCommand(0x54, Buffer.concat([Buffer.from([0, (data.length & 0xff), (data.length >> 8), 0, dma ? 0xb4 : 0xb5, 0, 2, 0, (dmalen & 0xff), (dmalen >> 8), device, 0x58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), data]), completed, dma); + obj.SendCommand(0x54, Buffer.concat([new Buffer([0, (data.length & 0xff), (data.length >> 8), 0, dma ? 0xb4 : 0xb5, 0, 2, 0, (dmalen & 0xff), (dmalen >> 8), device, 0x58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), data]), completed, dma); } } // GetDataFromHost (SCSI_CHUNK) obj.SendGetDataFromHost = function (device, chunksize) { - obj.SendCommand(0x52, Buffer.from([0, (chunksize & 0xff), (chunksize >> 8), 0, 0xb5, 0, 0, 0, (chunksize & 0xff), (chunksize >> 8), device, 0x58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), false); + obj.SendCommand(0x52, new Buffer([0, (chunksize & 0xff), (chunksize >> 8), 0, 0xb5, 0, 0, 0, (chunksize & 0xff), (chunksize >> 8), device, 0x58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), false); } // DisableEnableFeatures (STATUS_DATA) // If type is REGS_TOGGLE (3), 4 bytes of data must be provided. - obj.SendDisableEnableFeatures = function (type, data) { if (data == null) { data = ''; } obj.SendCommand(0x48, Buffer.concat([Buffer.from([type]), data])); } + obj.SendDisableEnableFeatures = function (type, data) { if (data == null) { data = ''; } obj.SendCommand(0x48, Buffer.concat([new Buffer([type]), data])); } // Private method obj.ProcessDataEx = function () { @@ -260,7 +260,7 @@ module.exports = function CreateAmtRemoteIder() { var len = ReadShortX(obj.acc, 9); if (obj.acc.length < (14 + len)) return 0; if (obj.debug) console.log('SCSI_WRITE, len = ' + (14 + len)); - obj.SendCommand(0x51, Buffer.from([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x70, 0x03, 0x00, 0x00, 0x00, 0xa0, 0x51, 0x07, 0x27, 0x00]), true); + obj.SendCommand(0x51, new Buffer([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x70, 0x03, 0x00, 0x00, 0x00, 0xa0, 0x51, 0x07, 0x27, 0x00]), true); return 14 + len; default: if (obj.debug) console.log('Unknown IDER command', obj.acc[0]); @@ -333,7 +333,7 @@ module.exports = function CreateAmtRemoteIder() { if (obj.debug) console.log("SCSI Internal error 6", dev); return -1; } - obj.SendDataToHost(dev, true, Buffer.from([0, a, b, 0]), featureRegister & 1); + obj.SendDataToHost(dev, true, new Buffer([0, a, b, 0]), featureRegister & 1); return; } obj.SendCommandEndResponse(1, 0x05, dev, 0x24, 0x00); @@ -370,7 +370,7 @@ module.exports = function CreateAmtRemoteIder() { return -1; } - obj.SendDataToHost(dev, true, Buffer.concat([IntToStr(8), Buffer.from([0x00, 0x00, 0x0b, 0x40, 0x02, 0x00, 0x02, 0x00]) ]), featureRegister & 1); + obj.SendDataToHost(dev, true, Buffer.concat([IntToStr(8), new Buffer([0x00, 0x00, 0x0b, 0x40, 0x02, 0x00, 0x02, 0x00]) ]), featureRegister & 1); break; case 0x25: // READ_CAPACITY if (obj.debug) console.log("SCSI: READ_CAPACITY", dev); @@ -393,7 +393,7 @@ module.exports = function CreateAmtRemoteIder() { } //if (dev == 0xA0) { dev = 0x00; } else { dev = 0x10; } // Weird but seems to work. if (obj.debug) console.log("SCSI: READ_CAPACITY2", dev, deviceFlags); - obj.SendDataToHost(deviceFlags, true, Buffer.concat([IntToStr(len), Buffer.from([0, 0, ((dev == 0xB0) ? 0x08 : 0x02), 0])]), featureRegister & 1); + obj.SendDataToHost(deviceFlags, true, Buffer.concat([IntToStr(len), new Buffer([0, 0, ((dev == 0xB0) ? 0x08 : 0x02), 0])]), featureRegister & 1); break; case 0x28: // READ_10 lba = ReadInt(cdb, 2); @@ -427,12 +427,12 @@ module.exports = function CreateAmtRemoteIder() { return -1; } - if (format == 1) { obj.SendDataToHost(dev, true, Buffer.from([0x00, 0x0a, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00]), featureRegister & 1); } + if (format == 1) { obj.SendDataToHost(dev, true, new Buffer([0x00, 0x0a, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00]), featureRegister & 1); } else if (format == 0) { if (msf) { - obj.SendDataToHost(dev, true, Buffer.from([0x00, 0x12, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0xaa, 0x00, 0x00, 0x00, 0x34, 0x13]), featureRegister & 1); + obj.SendDataToHost(dev, true, new Buffer([0x00, 0x12, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0xaa, 0x00, 0x00, 0x00, 0x34, 0x13]), featureRegister & 1); } else { - obj.SendDataToHost(dev, true, Buffer.from([0x00, 0x12, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00]), featureRegister & 1); + obj.SendDataToHost(dev, true, new Buffer([0x00, 0x12, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00]), featureRegister & 1); } } break; @@ -482,10 +482,10 @@ module.exports = function CreateAmtRemoteIder() { var present = 0x00; if ((dev == 0xA0) && (obj.floppy != null)) { present = 0x02; } else if ((dev == 0xB0) && (obj.cdrom != null)) { present = 0x02; } - obj.SendDataToHost(dev, true, Buffer.from([0x00, present, 0x80, 0x00]), featureRegister & 1); // This is the original version, 4 bytes long + obj.SendDataToHost(dev, true, new Buffer([0x00, present, 0x80, 0x00]), featureRegister & 1); // This is the original version, 4 bytes long break; case 0x4c: - obj.SendCommand(0x51, Buffer.concat([IntToStrX(0), IntToStrX(0), IntToStrX(0), Buffer.from([0x87, 0x50, 0x03, 0x00, 0x00, 0x00, 0xb0, 0x51, 0x05, 0x20, 0x00]) ]), true); + obj.SendCommand(0x51, Buffer.concat([IntToStrX(0), IntToStrX(0), IntToStrX(0), new Buffer([0x87, 0x50, 0x03, 0x00, 0x00, 0x00, 0xb0, 0x51, 0x05, 0x20, 0x00]) ]), true); break; case 0x51: // READ_DISC_INFO if (obj.debug) console.log("SCSI READ_DISC_INFO", dev); @@ -590,10 +590,10 @@ module.exports = function CreateAmtRemoteIder() { return obj; } -function ShortToStr(v) { return Buffer.from([(v >> 8) & 0xFF, v & 0xFF]); } -function ShortToStrX(v) { return Buffer.from([v & 0xFF, (v >> 8) & 0xFF]); } -function IntToStr(v) { return Buffer.from([(v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF]); } -function IntToStrX(v) { return Buffer.from([v & 0xFF, (v >> 8) & 0xFF, (v >> 16) & 0xFF, (v >> 24) & 0xFF]); } +function ShortToStr(v) { return new Buffer([(v >> 8) & 0xFF, v & 0xFF]); } +function ShortToStrX(v) { return new Buffer([v & 0xFF, (v >> 8) & 0xFF]); } +function IntToStr(v) { return new Buffer([(v >> 24) & 0xFF, (v >> 16) & 0xFF, (v >> 8) & 0xFF, v & 0xFF]); } +function IntToStrX(v) { return new Buffer([v & 0xFF, (v >> 8) & 0xFF, (v >> 16) & 0xFF, (v >> 24) & 0xFF]); } function ReadShort(v, p) { return (v[p] << 8) + v[p + 1]; } function ReadShortX(v, p) { return (v[p + 1] << 8) + v[p]; } function ReadInt(v, p) { return (v[p] * 0x1000000) + (v[p + 1] << 16) + (v[p + 2] << 8) + v[p + 3]; } // We use "*0x1000000" instead of "<<24" because the shift converts the number to signed int32. diff --git a/agents/modules_meshcmd/amt-redir-duk.js b/agents/modules_meshcmd/amt-redir-duk.js index 0667021b..512c0cd5 100644 --- a/agents/modules_meshcmd/amt-redir-duk.js +++ b/agents/modules_meshcmd/amt-redir-duk.js @@ -175,8 +175,8 @@ module.exports = function CreateAmtRedirect(module) { var digest = hex_md5(hex_md5(obj.user + ":" + realm + ":" + obj.pass) + ":" + nonce + ":" + extra + hex_md5("POST:" + obj.authuri)); var totallen = obj.user.length + realm.length + nonce.length + obj.authuri.length + cnonce.length + snc.length + digest.length + 7; if (authType == 4) totallen += (qop.length + 1); - var buf = Buffer.concat([Buffer.from([0x13, 0x00, 0x00, 0x00, authType]), new Buffer([totallen & 0xFF, (totallen >> 8) & 0xFF, 0x00, 0x00]), new Buffer([obj.user.length]), new Buffer(obj.user), new Buffer([realm.length]), new Buffer(realm), new Buffer([nonce.length]), new Buffer(nonce), new Buffer([obj.authuri.length]), new Buffer(obj.authuri), new Buffer([cnonce.length]), new Buffer(cnonce), new Buffer([snc.length]), new Buffer(snc), new Buffer([digest.length]), new Buffer(digest)]); - if (authType == 4) buf = Buffer.concat([buf, Buffer.from([qop.length]), new Buffer(qop) ]); + var buf = Buffer.concat([new Buffer([0x13, 0x00, 0x00, 0x00, authType]), new Buffer([totallen & 0xFF, (totallen >> 8) & 0xFF, 0x00, 0x00]), new Buffer([obj.user.length]), new Buffer(obj.user), new Buffer([realm.length]), new Buffer(realm), new Buffer([nonce.length]), new Buffer(nonce), new Buffer([obj.authuri.length]), new Buffer(obj.authuri), new Buffer([cnonce.length]), new Buffer(cnonce), new Buffer([snc.length]), new Buffer(snc), new Buffer([digest.length]), new Buffer(digest)]); + if (authType == 4) buf = Buffer.concat([buf, new Buffer([qop.length]), new Buffer(qop) ]); obj.xxSend(buf); } else if (status == 0) { // Success @@ -194,7 +194,7 @@ module.exports = function CreateAmtRedirect(module) { } if (obj.protocol == 2) { // Remote Desktop: Send traffic directly... - obj.xxSend(Buffer.from([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])); + obj.xxSend(new Buffer([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])); } if (obj.protocol == 3) { // Remote IDER: Send traffic directly... @@ -264,7 +264,7 @@ module.exports = function CreateAmtRedirect(module) { obj.xxRandomValueHex = function (len) { var t = [], l = Math.floor(len / 2); for (var i = 0; i < l; i++) { t.push(obj.tls.generateRandomInteger("0", "255")); } - return Buffer.from(t).toString('hex'); + return new Buffer(t).toString('hex'); } obj.xxOnSocketClosed = function () { @@ -291,9 +291,9 @@ module.exports = function CreateAmtRedirect(module) { if (obj.amtkeepalivetimer != null) { clearInterval(obj.amtkeepalivetimer); obj.amtkeepalivetimer = null; } } - obj.RedirectStartSol = Buffer.from([0x10, 0x00, 0x00, 0x00, 0x53, 0x4F, 0x4C, 0x20]); - obj.RedirectStartKvm = Buffer.from([0x10, 0x01, 0x00, 0x00, 0x4b, 0x56, 0x4d, 0x52]); - obj.RedirectStartIder = Buffer.from([0x10, 0x00, 0x00, 0x00, 0x49, 0x44, 0x45, 0x52]); + obj.RedirectStartSol = new Buffer([0x10, 0x00, 0x00, 0x00, 0x53, 0x4F, 0x4C, 0x20]); + obj.RedirectStartKvm = new Buffer([0x10, 0x01, 0x00, 0x00, 0x4b, 0x56, 0x4d, 0x52]); + obj.RedirectStartIder = new Buffer([0x10, 0x00, 0x00, 0x00, 0x49, 0x44, 0x45, 0x52]); return obj; } From 18ecafe3e30e86ad932a21a8b2728cae29ed2910 Mon Sep 17 00:00:00 2001 From: Chris Thornton Date: Mon, 4 Apr 2022 13:10:47 -0700 Subject: [PATCH 2/9] Use the right response variable when printing an error message --- agents/meshcmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 01957742..51b65642 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -3016,7 +3016,7 @@ function powerActionResponse3(stack, name, response, status) { var cbparam='
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSettingIntel(r) AMT: ' + bootsources[settings.bootdevice] + ''; if (!settings.bootdevice) { cbparam=null;} amtstack.CIM_BootConfigSetting_ChangeBootOrder(cbparam, function(st, nm, resp, sts) { - if (resp.Body['ReturnValue'] != 0) { console.log('(2) Change Boot Order returns '+ response.Body.ReturnValueStr); exit(1); return; } + if (resp.Body['ReturnValue'] != 0) { console.log('(2) Change Boot Order returns '+ resp.Body.ReturnValueStr); exit(1); return; } amtstack.RequestPowerStateChange(settings.poweraction, performAmtPowerActionEx); }); } From 4a516a9f8cea2407967ea4be9079b40a0f43ba49 Mon Sep 17 00:00:00 2001 From: Chris Thornton Date: Mon, 4 Apr 2022 14:21:06 -0700 Subject: [PATCH 3/9] Add ider-floppy and ider-cdrom as boot options to amtpower --- agents/meshcmd.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 51b65642..ed8fea31 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -295,10 +295,10 @@ function run(argv) { console.log(' --pass [password] The Intel AMT login password.'); console.log('\r\nOptional arguments:\r\n'); console.log(' --reset, --poweron, --poweroff, --powercycle, --sleep, --hibernate'); - console.log(' --user [username] The Intel AMT login username, admin is default.'); - console.log(' --tls Specifies that TLS must be used.'); - console.log(' --bootdevice [pxe|hdd|cd] Specifies the boot device to use after reset, poweron or powercycle.'); - console.log(' --bootindex [number] Specifies the index of boot device to use.'); + console.log(' --user [username] The Intel AMT login username, admin is default.'); + console.log(' --tls Specifies that TLS must be used.'); + console.log(' --bootdevice [pxe|hdd|cd|ider-floppy|ider-cdrom] Specifies the boot device to use after reset, poweron or powercycle.'); + console.log(' --bootindex [number] Specifies the index of boot device to use.'); } else if (action == 'amtnetwork') { console.log('AmtNetwork is used to get/set Intel AMT network interface configuration. Example usage:\r\n\r\n meshcmd amtnetwork --host 1.2.3.4 --user admin --pass mypassword --dhcp'); console.log('\r\nRequired arguments:\r\n'); @@ -842,13 +842,20 @@ function run(argv) { //if (settings.poweraction == 0) { console.log('No power action, specify --poweron, --sleep, --powercycle, --poweroff, --hibernate, --reset.'); exit(1); return; } // Accepted option for boot device are: pxe, hdd, cd var bootdevices = ['pxe','hdd','cd']; + var ider_bootdevices = ['ider-floppy', 'ider-cdrom'] if (args.bootdevice) { if (bootdevices.indexOf(args.bootdevice.toLowerCase())>=0) { settings.bootdevice = args.bootdevice // Set bootindex to 0 by default, unless overriden settings.bootindex = 0 + settings.ider_bootindex = 0 + settings.ider_boot = false; + } else if (ider_bootdevices.indexOf(args.bootdevice.toLowerCase())>=0) { + settings.bootindex = 0 + settings.ider_bootindex = ider_bootdevices.indexOf(args.bootdevice.toLowerCase()); + settings.ider_boot = true; } else { - console.log('Supported boot devices are pxe, hdd, cd'); exit(1); return; + console.log('Supported boot devices are pxe, hdd, cd, ider-floppy, ider-cdrom'); exit(1); return; } } // boot index for cd and hdd @@ -2945,7 +2952,7 @@ function performAmtPowerAction() { amtstack = new amt(wsstack); if (settings.poweraction != 0) { // Check if there is bootdevice and the command is either poweron, powercycle or reset - if (settings.bootdevice && [2,5,10].indexOf(settings.poweraction)>=0) { + if ((settings.bootdevice || settings.ider_boot) && [2,5,10].indexOf(settings.poweraction)>=0) { // Change boot order amtstack.Get('AMT_BootSettingData', powerActionResponse1, 0, 1); } else { @@ -2972,14 +2979,14 @@ function powerActionResponse1(stack, name, response, status) { } r['FirmwareVerbosity'] = 0; r['ForcedProgressEvents'] = false; - r['IDERBootDevice'] = 0; + r['IDERBootDevice'] = settings.ider_bootindex; r['LockKeyboard'] = false; r['LockPowerButton'] = false; r['LockResetButton'] = false; r['LockSleepButton'] = false; r['ReflashBIOS'] = false; - r['UseIDER'] = false; - r['UseSOL'] = false;// + r['UseIDER'] = settings.ider_boot; + r['UseSOL'] = settings.ider_boot r['UseSafeMode'] = false; r['UserPasswordBypass'] = false; if (r['SecureErase'] != null) { @@ -3014,7 +3021,7 @@ function powerActionResponse3(stack, name, response, status) { if (status != 200) { console.log('SetBootConfigRole failed.'); exit(1); return; } var bootsources = { 'pxe' : 'Force PXE Boot', 'hdd' : 'Force Hard-drive Boot', 'cd' : 'Force CD/DVD Boot'}; var cbparam='
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootSourceSettingIntel(r) AMT: ' + bootsources[settings.bootdevice] + ''; - if (!settings.bootdevice) { cbparam=null;} + if (!(settings.bootdevice in bootsources)) { cbparam=null;} amtstack.CIM_BootConfigSetting_ChangeBootOrder(cbparam, function(st, nm, resp, sts) { if (resp.Body['ReturnValue'] != 0) { console.log('(2) Change Boot Order returns '+ resp.Body.ReturnValueStr); exit(1); return; } amtstack.RequestPowerStateChange(settings.poweraction, performAmtPowerActionEx); From 4787df172b0eec113123708b09473add8ed62d7d Mon Sep 17 00:00:00 2001 From: Chris Thornton Date: Mon, 4 Apr 2022 14:58:33 -0700 Subject: [PATCH 4/9] Propagate rx_timeout into the ider object (The session may get closed before the timeout expires if set to longer than the default of 30 seconds) --- agents/meshcmd.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index ed8fea31..4158679c 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -2302,7 +2302,10 @@ function performIder() { ider.m.cdrom = scdrom; ider.m.iderStart = 1; // OnReboot = 0, Graceful = 1, Now = 2 ider.m.debug = (settings.debuglevel > 0); - if (settings.timeout > 0) { ider.m.sectorStats = iderSectorStats; } + if (settings.timeout > 0) { + ider.m.sectorStats = iderSectorStats; + ider.m.rx_timeout = settings.timeout; + } //ider.digestRealmMatch = wsstack.comm.digestRealm; //ider.tlsv1only = amtstack.wsman.comm.tlsv1only; ider.Start(settings.hostname, (settings.tls == true) ? 16995 : 16994, settings.username ? 'admin' : settings.username, settings.password, settings.tls); From d8cb4d10e4a4502ec79478141666c30a5db39549 Mon Sep 17 00:00:00 2001 From: Chris Thornton Date: Mon, 4 Apr 2022 15:23:54 -0700 Subject: [PATCH 5/9] Add --iderstart as an option to amtider Allows you to change when the IDER session begins, either `onreboot`, `graceful` or `now` --- agents/meshcmd.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 4158679c..992ab63d 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -153,6 +153,7 @@ function run(argv) { if ((typeof args.scan) == 'string') { settings.scan = args.scan; } if ((typeof args.token) == 'string') { settings.token = args.token; } if ((typeof args.timeout) == 'string') { settings.timeout = parseInt(args.timeout); } + if ((typeof args.iderstart) == 'string') { settings.iderstart = args.iderstart; } if ((typeof args.uuidoutput) == 'string' || args.uuidoutput) { settings.uuidoutput = args.uuidoutput; } if ((typeof args.desc) == 'string') { settings.desc = args.desc; } if ((typeof args.dnssuffix) == 'string') { settings.dnssuffix = args.dnssuffix; } @@ -357,13 +358,14 @@ function run(argv) { } else if (action == 'amtider') { console.log('AmtIDER will mount a local disk images to a remote Intel AMT computer. Example usage:\r\n\r\n meshcmd amtider --host 1.2.3.4 --user admin --pass mypassword --tls --floppy disk.img --cdrom disk.iso'); console.log('\r\nPossible arguments:\r\n'); - console.log(' --host [hostname] The IP address or DNS name of Intel AMT.'); - console.log(' --user [username] The Intel AMT login username, admin is default.'); - console.log(' --pass [password] The Intel AMT login password.'); - console.log(' --tls Specifies that TLS must be used.'); - console.log(' --floppy [file] Specifies .img file to be mounted as a flppy disk.'); - console.log(' --cdrom [file] Specifies .img file to be mounted as a CDROM disk.'); - console.log(' --timeout [seconds] Optional, disconnect after number of seconds without disk read.'); + console.log(' --host [hostname] The IP address or DNS name of Intel AMT.'); + console.log(' --user [username] The Intel AMT login username, admin is default.'); + console.log(' --pass [password] The Intel AMT login password.'); + console.log(' --tls Specifies that TLS must be used.'); + console.log(' --floppy [file] Specifies .img file to be mounted as a flppy disk.'); + console.log(' --cdrom [file] Specifies .img file to be mounted as a CDROM disk.'); + console.log(' --timeout [seconds] Optional, disconnect after number of seconds without disk read.'); + console.log(' --iderstart [onreboot|graceful|now] Optional, when to start the IDER session.'); } else if (action == 'amtscan') { console.log('AmtSCAN will look for Intel AMT device on the network. Example usage:\r\n\r\n meshcmd amtscan --scan 192.168.1.0/24'); console.log('\r\Required arguments:\r\n'); @@ -862,7 +864,6 @@ function run(argv) { if (args.bootindex && args.bootindex >=0) { settings.bootindex = args.bootindex; } - performAmtPowerAction(); } else { console.log('Invalid "action" specified.'); exit(1); return; @@ -2291,6 +2292,8 @@ iderIdleTimer = null; function performIder() { if ((settings.floppy != null) && fs.existsSync(settings.floppy) == false) { console.log("Unable to floppy image file: " + settings.floppy); exit(); return; } if ((settings.cdrom != null) && fs.existsSync(settings.cdrom) == false) { console.log("Unable to CDROM image file: " + settings.cdrom); exit(); return; } + var iderStarts = ['onreboot', 'graceful', 'now']; + if ((settings.iderstart != null) && iderStarts.indexOf(settings.iderstart) < 0) { console.log("Unknown iderstart option: " + settings.iderstart); exit(); return; } try { var sfloppy = null, scdrom = null; if (settings.floppy) { try { if (sfloppy = fs.statSync(settings.floppy)) { sfloppy.file = fs.openSync(settings.floppy, 'rbN'); } } catch (ex) { console.log(ex); exit(1); return; } } @@ -2300,7 +2303,11 @@ function performIder() { ider.onStateChanged = onIderStateChange; ider.m.floppy = sfloppy; ider.m.cdrom = scdrom; - ider.m.iderStart = 1; // OnReboot = 0, Graceful = 1, Now = 2 + if (settings.iderstart) { + ider.m.iderStart = iderStarts.indexOf(settings.iderstart); + } else { + ider.m.iderStart = 1; // OnReboot = 0, Graceful = 1, Now = 2 + } ider.m.debug = (settings.debuglevel > 0); if (settings.timeout > 0) { ider.m.sectorStats = iderSectorStats; From b910cde272d25b5e029bc685d669360700dc7876 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 6 Apr 2022 15:41:50 -0700 Subject: [PATCH 6/9] More work on AMT 802.1x support. --- amtmanager.js | 173 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 134 insertions(+), 39 deletions(-) diff --git a/amtmanager.js b/amtmanager.js index 9a2e5baa..181303d3 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -438,34 +438,7 @@ module.exports.CreateAmtManager = function (parent) { // We got a new 802.1x profile devFound.netAuthCredentials = event.response; - console.log('devFound.netAuthCredentials', devFound.netAuthCredentials); - if (devFound.netAuthCredentials.certificate) { - // The new 802.1x profile includes a new certificate, add it now before adding the 802.1x profiles - // devFound.netAuthCredentials.certificate must be in DER encoded format - devFound.consoleMsg("Setting up new 802.1x certificate..."); - - const f = function AddCertificateResponse(stack, name, response, status) { - if ((status != 200) || (response.Body['ReturnValue'] != 0)) { - AddCertificateResponse.dev.consoleMsg("Unable to set 802.1x certificate."); - } else { - console.log('AddCertificate - TODO', response); - // TODO: Keep the certificate reference since we need it to add 802.1x profiles - - // Set the 802.1x wired profile in the device - AddCertificateResponse.dev.consoleMsg("Setting MeshCentral Satellite 802.1x profile..."); - const netAuthSatReqData = AddCertificateResponse.dev.netAuthSatReqData; - attempt8021xSyncEx(AddCertificateResponse.dev, netAuthSatReqData); - } - } - f.dev = devFound; - devFound.amtstack.AMT_PublicKeyManagementService_AddCertificate(devFound.netAuthCredentials.certificate, f); - } else { - // No 802.1x certificate, set the 802.1x wired profile in the device - devFound.consoleMsg("Setting MeshCentral Satellite 802.1x profile..."); - const netAuthSatReqData = devFound.netAuthSatReqData; - delete devFound.netAuthSatReqData; - attempt8021xSyncEx(devFound, netAuthSatReqData); - } + perform8021xRootCertCheck(devFound); break; } } @@ -1363,6 +1336,23 @@ module.exports.CreateAmtManager = function (parent) { // Intel AMT WIFI // + // Check which key pair matches the public key in the certificate + function amtcert_linkCertPrivateKey(certs, keys) { + for (var i in certs) { + var cert = certs[i]; + try { + if (keys.length == 0) return; + var publicKeyPEM = forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(cert.X509Certificate)).publicKey).substring(28 + 32).replace(/(\r\n|\n|\r)/gm, ""); + for (var j = 0; j < keys.length; j++) { + if (publicKeyPEM === (keys[j]['DERKey'] + '-----END PUBLIC KEY-----')) { + keys[j].XCert = cert; // Link the key pair to the certificate + cert.XPrivateKey = keys[j]; // Link the certificate to the key pair + } + } + } catch (e) { console.log(e); } + } + } + // This method will sync the WIFI profiles from the device and the server, but does not care about profile priority. // We also sync wired 802.1x at the same time since we only allow a single 802.1x profile per device shared between wired and wireless // We may want to work on an alternate version that does do priority if requested. @@ -1377,17 +1367,41 @@ module.exports.CreateAmtManager = function (parent) { dev.taskCount = 1; dev.taskCompleted = func; - const objQuery = ['CIM_WiFiEndpointSettings', '*CIM_WiFiPort', '*AMT_WiFiPortConfigurationService', 'CIM_IEEE8021xSettings']; + const objQuery = ['CIM_WiFiEndpointSettings', '*CIM_WiFiPort', '*AMT_WiFiPortConfigurationService', 'CIM_IEEE8021xSettings', 'AMT_PublicKeyCertificate', 'AMT_PublicPrivateKeyPair']; if (parent.config.domains[dev.domainid].amtmanager['802.1x'] != null) { objQuery.push('*AMT_8021XProfile'); } dev.amtstack.BatchEnum(null, objQuery, function (stack, name, responses, status) { const dev = stack.dev; if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. const domain = parent.config.domains[dev.domainid]; + if ((responses['AMT_PublicKeyCertificate'].status != 200) || (responses['AMT_PublicKeyCertificate'].status != 200)) { devTaskCompleted(dev); return; } // We can't get the certificate list, fail and carry on. + // See if we need to perform wired or wireless 802.1x configuration const wiredConfig = ((parent.config.domains[dev.domainid].amtmanager['802.1x'] != null) && (responses['AMT_8021XProfile'].status == 200)); const wirelessConfig = ((responses['CIM_WiFiEndpointSettings'].status == 200) && (responses['AMT_WiFiPortConfigurationService'].status == 200) && (responses['CIM_WiFiPort'].status == 200) && (responses['CIM_IEEE8021xSettings'].status == 200)); if (!wiredConfig && !wirelessConfig) { devTaskCompleted(dev); return; } // We can't get wired or wireless settings, ignore and carry on. + // Sort out the certificates + var xxCertificates = responses['AMT_PublicKeyCertificate'].responses; + var xxCertPrivateKeys = responses['AMT_PublicPrivateKeyPair'].responses; + for (var i in xxCertificates) { + xxCertificates[i].TrustedRootCertficate = (xxCertificates[i]['TrustedRootCertficate'] == true); + xxCertificates[i].X509CertificateBin = Buffer.from(xxCertificates[i]['X509Certificate'], 'base64').toString('binary'); + xxCertificates[i].XIssuer = parseCertName(xxCertificates[i]['Issuer']); + xxCertificates[i].XSubject = parseCertName(xxCertificates[i]['Subject']); + } + amtcert_linkCertPrivateKey(xxCertificates, xxCertPrivateKeys); // This links all certificates and private keys + + // Remove any unlinked private keys + for (var i in xxCertPrivateKeys) { + if (!xxCertPrivateKeys[i].XCert) { + console.log('PrivateKey-Removing'); + dev.amtstack.Delete('AMT_PublicPrivateKeyPair', { 'InstanceID': xxCertPrivateKeys[i]['InstanceID'] }, function (stack, name, response, status) { + console.log('PrivateKey-Removed'); + //if (status == 200) { dev.consoleMsg("Removed unassigned private key pair."); } + }); + } + } + // Check if wired 802.1x needs updating var newNetAuthProfileRequested = false; var srvNetAuthProfile = domain.amtmanager['802.1x']; @@ -1509,7 +1523,7 @@ module.exports.CreateAmtManager = function (parent) { // Send a message to Satellite requesting a 802.1x profile for this device dev.consoleMsg("Requesting 802.1x credentials for " + netAuthStrings[srvNetAuthProfile.authenticationprotocol] + " from MeshCentral Satellite..."); dev.netAuthSatReqId = Buffer.from(parent.crypto.randomBytes(16), 'binary').toString('base64'); // Generate a crypto-secure request id. - dev.netAuthSatReqData = { domain: domain, wiredConfig: wiredConfig, wirelessConfig: wirelessConfig, devNetAuthProfile: devNetAuthProfile, srvNetAuthProfile: srvNetAuthProfile, profilesToAdd: profilesToAdd, prioritiesInUse: prioritiesInUse, responses: responses } + dev.netAuthSatReqData = { domain: domain, wiredConfig: wiredConfig, wirelessConfig: wirelessConfig, devNetAuthProfile: devNetAuthProfile, srvNetAuthProfile: srvNetAuthProfile, profilesToAdd: profilesToAdd, prioritiesInUse: prioritiesInUse, responses: responses, xxCertificates: xxCertificates, xxCertPrivateKeys: xxCertPrivateKeys } parent.DispatchEvent([srvNetAuthProfile.satellitecredentials], obj, { action: 'satellite', subaction: '802.1x-ProFile-Request', satelliteFlags: 2, nodeid: dev.nodeid, icon: dev.icon, domain: dev.nodeid.split('/')[1], nolog: 1, reqid: dev.netAuthSatReqId, authProtocol: srvNetAuthProfile.authenticationprotocol, devname: dev.name, osname: dev.rname }); // Set a response timeout @@ -1527,12 +1541,81 @@ module.exports.CreateAmtManager = function (parent) { return; } else { // No need to call MeshCentral Satellite for a 802.1x profile, so configure everything now. - attempt8021xSyncEx(dev, { domain: domain, wiredConfig: wiredConfig, wirelessConfig: wirelessConfig, devNetAuthProfile: devNetAuthProfile, srvNetAuthProfile: srvNetAuthProfile, profilesToAdd: profilesToAdd, prioritiesInUse: prioritiesInUse, responses: responses }); + attempt8021xSyncEx(dev, { domain: domain, wiredConfig: wiredConfig, wirelessConfig: wirelessConfig, devNetAuthProfile: devNetAuthProfile, srvNetAuthProfile: srvNetAuthProfile, profilesToAdd: profilesToAdd, prioritiesInUse: prioritiesInUse, responses: responses, xxCertificates: xxCertificates, xxCertPrivateKeys: xxCertPrivateKeys }); } } }); } + + // Check 802.1x root certificate + function perform8021xRootCertCheck(dev) { + // Check if there is a root certificate to add, if we already have it, get the instance id. + if (dev.netAuthCredentials.rootcert) { + var matchingRootCertId = null; + for (var i in dev.netAuthSatReqData.xxCertificates) { + if ((dev.netAuthSatReqData.xxCertificates[i].X509Certificate == dev.netAuthCredentials.rootcert) && (dev.netAuthSatReqData.xxCertificates[i].TrustedRootCertficate)) { + matchingRootCertId = dev.netAuthSatReqData.xxCertificates[i].InstanceID; + } + } + if (matchingRootCertId == null) { + // Root certificate not found, add it + dev.consoleMsg("Setting up new 802.1x root certificate..."); + const f = function perform8021xRootCertCheckResponse(stack, name, response, status) { + if ((status != 200) || (response.Body['ReturnValue'] != 0)) { + // Failed to add the root certificate + dev.consoleMsg("Failed to sign the certificate request."); + } else { + // Root certificate added, move on to client certificate checking + perform8021xRootCertCheckResponse.dev.netAuthSatReqData.rootCertInstanceId = response.Body.CreatedCertificate.ReferenceParameters.SelectorSet.Selector.Value; + perform8021xClientCertCheck(perform8021xRootCertCheckResponse.dev); + } + } + f.dev = dev; + dev.amtstack.AMT_PublicKeyManagementService_AddTrustedRootCertificate(dev.netAuthCredentials.rootcert, f); + } else { + // Root certificate already present, move on to client certificate checking + dev.netAuthSatReqData.rootCertInstanceId = matchingRootCertId; + perform8021xClientCertCheck(dev); + } + } else { + // No root certificate to check, move on to client certificate checking + perform8021xClientCertCheck(dev); + } + } + + // Check 802.1x client certificate + function perform8021xClientCertCheck(dev) { + if (dev.netAuthCredentials.certificate) { + // The new 802.1x profile includes a new certificate, add it now before adding the 802.1x profiles + // dev.netAuthCredentials.certificate must be in DER encoded format + dev.consoleMsg("Setting up new 802.1x client certificate..."); + const f = function AddCertificateResponse(stack, name, response, status) { + if ((status != 200) || (response.Body['ReturnValue'] != 0)) { + AddCertificateResponse.dev.consoleMsg("Unable to set 802.1x certificate."); + } else { + // Keep the certificate reference since we need it to add 802.1x profiles + const certInstanceId = response.Body.CreatedCertificate.ReferenceParameters.SelectorSet.Selector.Value; + + // Set the 802.1x wired profile in the device + AddCertificateResponse.dev.consoleMsg("Setting MeshCentral Satellite 802.1x profile..."); + const netAuthSatReqData = AddCertificateResponse.dev.netAuthSatReqData; + delete dev.netAuthSatReqData; + netAuthSatReqData.certInstanceId = certInstanceId; + attempt8021xSyncEx(AddCertificateResponse.dev, netAuthSatReqData); + } + } + f.dev = dev; + dev.amtstack.AMT_PublicKeyManagementService_AddCertificate(dev.netAuthCredentials.certificate, f); + } else { + // No 802.1x certificate, set the 802.1x wired profile in the device + dev.consoleMsg("Setting MeshCentral Satellite 802.1x profile..."); + const netAuthSatReqData = dev.netAuthSatReqData; + delete dev.netAuthSatReqData; + attempt8021xSyncEx(dev, netAuthSatReqData); + } + } + // Set the 802.1x wired profile function attempt8021xSyncEx(dev, devNetAuthData) { // Unpack @@ -1568,8 +1651,21 @@ module.exports.CreateAmtManager = function (parent) { delete netAuthProfile['ProtectedAccessCredential']; delete netAuthProfile['PACPassword']; } - //if (parseInt(Q('idx_d27clientcert').value) >= 0) { netAuthProfile['ClientCertificate'] = '/wsman' + amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + xxCertificates[parseInt(Q('idx_d27clientcert').value)]['InstanceID'] + ''; } else { delete sc['ClientCertificate']; } - //if (parseInt(Q('idx_d27servercert').value) >= 0) { netAuthProfile['ServerCertificateIssuer'] = '/wsman' + amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + xxCertificates[parseInt(Q('idx_d27servercert').value)]['InstanceID'] + ''; } else { delete sc['ServerCertificateIssuer']; } + + // Setup Client Certificate + if (devNetAuthData.certInstanceId) { + netAuthProfile['ClientCertificate'] = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.certInstanceId + ''; + } else { + delete netAuthProfile['ClientCertificate']; + } + + // Setup Server Certificate + if (devNetAuthData.rootCertInstanceId) { + netAuthProfile['ServerCertificateIssuer'] = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.rootCertInstanceId + ''; + } else { + delete netAuthProfile['ServerCertificateIssuer']; + } + netAuthProfile['PxeTimeout'] = (typeof srvNetAuthProfile.pxetimeoutinseconds == 'number') ? srvNetAuthProfile.pxetimeoutinseconds : 120; // If we have a MeshCentral Satellite profile, use that @@ -1580,10 +1676,14 @@ module.exports.CreateAmtManager = function (parent) { if (srvNetAuthProfile2.domain && (srvNetAuthProfile2.domain != '')) { netAuthProfile['Domain'] = srvNetAuthProfile2.domain; } } } + + console.log('netAuthProfile', netAuthProfile); + dev.amtstack.Put('AMT_8021XProfile', netAuthProfile, function (stack, name, responses, status) { const dev = stack.dev; if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. - if (status == 200) { dev.consoleMsg("802.1x wired profile set."); } + console.log('AMT_8021XProfile-PUT', responses); + if (status == 200) { dev.consoleMsg("802.1x wired profile set."); } else { dev.consoleMsg("Unable to set 802.1x wired profile."); } attemptWifiSyncEx(dev, devNetAuthData); }); } else { @@ -1706,11 +1806,6 @@ module.exports.CreateAmtManager = function (parent) { if (xresponse[i]['InstanceID'] == keyInstanceId) { // We found our matching DER key DERKey = xresponse[i]['DERKey']; - } else { - // This is not a matching key, since we are here, clean it up. - dev.amtstack.Delete('AMT_PublicPrivateKeyPair', { 'InstanceID': xresponse[i]['InstanceID'] }, function (stack, name, response, status) { - //if (status == 200) { dev.consoleMsg("Removed unassigned private key pair."); } - }); } } if (DERKey == null) { dev.consoleMsg("Failed to match the generated RSA key pair."); return; } From 90d2d7b21b9b93668311c41988563e5346873de7 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 6 Apr 2022 19:55:32 -0700 Subject: [PATCH 7/9] More work on AMT 802.1x support. --- amt/amt.js | 5 +- amtmanager.js | 199 ++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 156 insertions(+), 48 deletions(-) diff --git a/amt/amt.js b/amt/amt.js index 0ec62801..4699e9ea 100644 --- a/amt/amt.js +++ b/amt/amt.js @@ -304,7 +304,10 @@ function AmtStackCreateService(wsmanStack) { obj.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch = function (Ta0, Tm1, Tm2, callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "SetHighAccuracyTimeSynch", { "Ta0": Ta0, "Tm1": Tm1, "Tm2": Tm2 }, callback_func, tag); } obj.AMT_UserInitiatedConnectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_UserInitiatedConnectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); } obj.AMT_WebUIService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func, tag) { obj.Exec("AMT_WebUIService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func, tag); } - obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); } + obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { + console.log(JSON.stringify({ "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, null, 2)); + obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); + } obj.AMT_WiFiPortConfigurationService_UpdateWiFiSettings = function (WiFiEndpointSettings, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "UpdateWiFiSettings", { "WiFiEndpointSettings": WiFiEndpointSettings, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); } obj.AMT_WiFiPortConfigurationService_DeleteAllITProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllITProfiles", { "_method_dummy": _method_dummy }, callback_func); } obj.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllUserProfiles", { "_method_dummy": _method_dummy }, callback_func); } diff --git a/amtmanager.js b/amtmanager.js index 181303d3..738fe125 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -737,23 +737,26 @@ module.exports.CreateAmtManager = function (parent) { attemptCiraSync(dev, function (dev) { // Check Intel AMT settings attemptSettingsSync(dev, function (dev) { - // See if we need to get hardware inventory - attemptFetchHardwareInventory(dev, function (dev) { - dev.consoleMsg('Done.'); + // Clean unused certificates + attemptCleanCertsSync(dev, function (dev) { + // See if we need to get hardware inventory + attemptFetchHardwareInventory(dev, function (dev) { + dev.consoleMsg('Done.'); - // Remove from task limiter if needed - if (dev.taskid != null) { obj.parent.taskLimiter.completed(dev.taskid); delete dev.taskLimiter; } + // Remove from task limiter if needed + if (dev.taskid != null) { obj.parent.taskLimiter.completed(dev.taskid); delete dev.taskLimiter; } - if (dev.connType != 2) { - // Start power polling if not connected to LMS - var ppfunc = function powerPoleFunction() { fetchPowerState(powerPoleFunction.dev); } - ppfunc.dev = dev; - dev.polltimer = new setTimeout(ppfunc, 290000); // Poll for power state every 4 minutes 50 seconds. - fetchPowerState(dev); - } else { - // For LMS connections, close now. - dev.controlMsg({ action: 'close' }); - } + if (dev.connType != 2) { + // Start power polling if not connected to LMS + var ppfunc = function powerPoleFunction() { fetchPowerState(powerPoleFunction.dev); } + ppfunc.dev = dev; + dev.polltimer = new setTimeout(ppfunc, 290000); // Poll for power state every 4 minutes 50 seconds. + fetchPowerState(dev); + } else { + // For LMS connections, close now. + dev.controlMsg({ action: 'close' }); + } + }); }); }); }); @@ -1394,9 +1397,7 @@ module.exports.CreateAmtManager = function (parent) { // Remove any unlinked private keys for (var i in xxCertPrivateKeys) { if (!xxCertPrivateKeys[i].XCert) { - console.log('PrivateKey-Removing'); dev.amtstack.Delete('AMT_PublicPrivateKeyPair', { 'InstanceID': xxCertPrivateKeys[i]['InstanceID'] }, function (stack, name, response, status) { - console.log('PrivateKey-Removed'); //if (status == 200) { dev.consoleMsg("Removed unassigned private key pair."); } }); } @@ -1550,6 +1551,8 @@ module.exports.CreateAmtManager = function (parent) { // Check 802.1x root certificate function perform8021xRootCertCheck(dev) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + // Check if there is a root certificate to add, if we already have it, get the instance id. if (dev.netAuthCredentials.rootcert) { var matchingRootCertId = null; @@ -1586,6 +1589,8 @@ module.exports.CreateAmtManager = function (parent) { // Check 802.1x client certificate function perform8021xClientCertCheck(dev) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + if (dev.netAuthCredentials.certificate) { // The new 802.1x profile includes a new certificate, add it now before adding the 802.1x profiles // dev.netAuthCredentials.certificate must be in DER encoded format @@ -1618,6 +1623,8 @@ module.exports.CreateAmtManager = function (parent) { // Set the 802.1x wired profile function attempt8021xSyncEx(dev, devNetAuthData) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + // Unpack const domain = devNetAuthData.domain; const devNetAuthProfile = devNetAuthData.devNetAuthProfile; @@ -1677,12 +1684,9 @@ module.exports.CreateAmtManager = function (parent) { } } - console.log('netAuthProfile', netAuthProfile); - dev.amtstack.Put('AMT_8021XProfile', netAuthProfile, function (stack, name, responses, status) { const dev = stack.dev; if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. - console.log('AMT_8021XProfile-PUT', responses); if (status == 200) { dev.consoleMsg("802.1x wired profile set."); } else { dev.consoleMsg("Unable to set 802.1x wired profile."); } attemptWifiSyncEx(dev, devNetAuthData); }); @@ -1693,6 +1697,8 @@ module.exports.CreateAmtManager = function (parent) { } function attemptWifiSyncEx(dev, devNetAuthData) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + // Unpack const domain = devNetAuthData.domain; const devNetAuthProfile = devNetAuthData.devNetAuthProfile; @@ -1705,7 +1711,7 @@ module.exports.CreateAmtManager = function (parent) { if (wirelessConfig) { // Add missing WIFI profiles - var nextPriority = 0; + var nextPriority = 1; for (var i in profilesToAdd) { while (prioritiesInUse.indexOf(nextPriority) >= 0) { nextPriority++; } // Figure out the next available priority slot. var profileToAdd = profilesToAdd[i]; @@ -1741,8 +1747,26 @@ module.exports.CreateAmtManager = function (parent) { if (domain.amtmanager['802.1x'].password) { netAuthProfile['Password'] = domain.amtmanager['802.1x'].password; } if (domain.amtmanager['802.1x'].domain) { netAuthProfile['Domain'] = domain.amtmanager['802.1x'].domain; } if (domain.amtmanager['802.1x'].authenticationprotocol > 3) { domain.amtmanager['ProtectedAccessCredential'] = profileToAdd['802.1x'].protectedaccesscredentialhex; netAuthProfile['PACPassword'] = profileToAdd['802.1x'].pacpassword; } - //if (parseInt(Q('idx_d12clientcert').value) >= 0) { netAuthSettingsClientCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + xxCertificates[parseInt(Q('idx_d12clientcert').value)]['InstanceID'] + ''; } - //if (parseInt(Q('idx_d12servercert').value) >= 0) { netAuthSettingsServerCaCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + xxCertificates[parseInt(Q('idx_d12servercert').value)]['InstanceID'] + ''; } + + /* + // Setup Client Certificate + if (devNetAuthData.certInstanceId) { + netAuthSettingsClientCert = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.certInstanceId + ''; + } + // Setup Server Certificate + if (devNetAuthData.rootCertInstanceId) { + netAuthSettingsServerCaCert = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.rootCertInstanceId + ''; + } + */ + + // Setup Client Certificate + if (devNetAuthData.certInstanceId) { + netAuthSettingsClientCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + devNetAuthData.certInstanceId + ''; + } + // Setup Server Certificate + if (devNetAuthData.rootCertInstanceId) { + netAuthSettingsServerCaCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + devNetAuthData.rootCertInstanceId + ''; + } // If we have credentials from MeshCentral Satelite, use that if (dev.netAuthCredentials != null) { @@ -1753,43 +1777,64 @@ module.exports.CreateAmtManager = function (parent) { } } prioritiesInUse.push(nextPriority); // Occupy the priority slot and add the WIFI profile. - dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, netAuthProfile, netAuthSettingsClientCert, netAuthSettingsServerCaCert, function (stack, name, responses, status) { }); - } + console.log('AddWiFiSettings1'); - // 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."); } + dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, netAuthProfile, netAuthSettingsClientCert, netAuthSettingsServerCaCert, function (stack, name, response, status) { + if (status != 200) { dev.consoleMsg("Unable to set WIFI profile."); } + console.log('AddWiFiSettings2', status, response); }); } - // 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 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; - if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. - if (status == 200) { dev.consoleMsg("Disabled WIFI."); } - }); - } else { - dev.amtstack.CIM_WiFiPort_RequestStateChange(wifiState, null, function (stack, name, responses, status) { - const dev = stack.dev; - if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. - if (status == 200) { dev.consoleMsg("Enabled WIFI."); } - }); - } + // Complete WIFI configuration + attemptWifiSyncEx2(dev, devNetAuthData); + } else { + // Done + devTaskCompleted(dev); + } + } + + function attemptWifiSyncEx2(dev, devNetAuthData) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + + const responses = devNetAuthData.responses; + + // 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 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; + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + if (status == 200) { dev.consoleMsg("Disabled WIFI."); } + }); + } else { + dev.amtstack.CIM_WiFiPort_RequestStateChange(wifiState, null, function (stack, name, responses, status) { + const dev = stack.dev; + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + if (status == 200) { dev.consoleMsg("Enabled WIFI."); } + }); } } + console.log('ALL GOOD'); + // Done devTaskCompleted(dev); } // Request for a RSA key pair generation. This will be used to generate the 802.1x certificate function attempt8021xKeyGeneration(dev) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + dev.amtstack.AMT_PublicKeyManagementService_GenerateKeyPair(0, 2048, function (stack, name, response, status) { if ((status != 200) || (response.Body['ReturnValue'] != 0)) { // Failed to generate a key pair @@ -1820,6 +1865,8 @@ module.exports.CreateAmtManager = function (parent) { // 802.1x request to process a Certificate Signing Request, we ask Intel AMT to sign the request function attempt8021xCRSRequest(dev, event) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + if ((event.response == null) || (event.response.keyInstanceId == null)) return; var keyPair = 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicPrivateKeyPair' + event.response.keyInstanceId + ''; // keyPair EPR Reference var signingAlgorithm = 1; // 0 = SHA1-RSA, 1 = SHA256-RSA @@ -2214,6 +2261,64 @@ module.exports.CreateAmtManager = function (parent) { } + // + // Intel AMT Certificate cleanup + // + + // Remove any unused, non-trusted certificates + function attemptCleanCertsSync(dev, func) { + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + dev.amtstack.BatchEnum(null, ['AMT_PublicKeyCertificate', 'AMT_PublicPrivateKeyPair'], function (stack, name, responses, status) { + const dev = stack.dev; + if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. + const domain = parent.config.domains[dev.domainid]; + if ((responses['AMT_PublicKeyCertificate'].status != 200) || (responses['AMT_PublicKeyCertificate'].status != 200)) { func(dev); return; } // We can't get the certificate list, fail and carry on. + + // Sort out the certificates + var xxCertificates = responses['AMT_PublicKeyCertificate'].responses; + var xxCertPrivateKeys = responses['AMT_PublicPrivateKeyPair'].responses; + for (var i in xxCertificates) { + xxCertificates[i].TrustedRootCertficate = (xxCertificates[i]['TrustedRootCertficate'] == true); + xxCertificates[i].X509CertificateBin = Buffer.from(xxCertificates[i]['X509Certificate'], 'base64').toString('binary'); + xxCertificates[i].XIssuer = parseCertName(xxCertificates[i]['Issuer']); + xxCertificates[i].XSubject = parseCertName(xxCertificates[i]['Subject']); + } + amtcert_linkCertPrivateKey(xxCertificates, xxCertPrivateKeys); // This links all certificates and private keys + dev.certDeleteTasks = 0; + + // Remove any unlinked private keys + for (var i in xxCertPrivateKeys) { + if (!xxCertPrivateKeys[i].XCert) { + dev.certDeleteTasks++; + dev.amtstack.Delete('AMT_PublicPrivateKeyPair', { 'InstanceID': xxCertPrivateKeys[i]['InstanceID'] }, function (stack, name, response, status) { + //if (status == 200) { dev.consoleMsg("Removed unassigned private key pair."); } + if (--dev.certDeleteTasks == 0) { delete dev.certDeleteTasks; func(dev); } + }); + } + } + + // Try to remove all untrusted certificates + for (var i in xxCertificates) { + if (xxCertificates[i].TrustedRootCertficate == false) { + var privateKeyInstanceId = null; + if (xxCertificates[i].XPrivateKey) { privateKeyInstanceId = { 'InstanceID': xxCertificates[i].XPrivateKey['InstanceID'] }; } + dev.certDeleteTasks++; + dev.amtstack.Delete('AMT_PublicKeyCertificate', { 'InstanceID': xxCertificates[i]['InstanceID'] }, function (stack, name, response, status, tag) { + if ((status == 200) && (tag != null)) { + // If there is a private key, delete it. + dev.amtstack.Delete('AMT_PublicPrivateKeyPair', tag, function () { + if (--dev.certDeleteTasks == 0) { delete dev.certDeleteTasks; func(dev); } + }, 0, 1); + } else { + if (--dev.certDeleteTasks == 0) { delete dev.certDeleteTasks; func(dev); } + } + }, privateKeyInstanceId); + } + } + }); + } + + // // Intel AMT Hardware Inventory and Networking // From ef72e5d393e0c759a39cff0ccc9208e382617240 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 7 Apr 2022 11:09:25 -0700 Subject: [PATCH 8/9] Fixed Intel AMT stack, exec with cert references would not work. --- amt/amt.js | 30 +++++++++++++++--------------- amtmanager.js | 27 +++++---------------------- public/scripts/amt-0.2.0.js | 32 ++++++++++++++++++-------------- 3 files changed, 38 insertions(+), 51 deletions(-) diff --git a/amt/amt.js b/amt/amt.js index 4699e9ea..548f9fe2 100644 --- a/amt/amt.js +++ b/amt/amt.js @@ -269,8 +269,7 @@ function AmtStackCreateService(wsmanStack) { obj.AMT_MessageLog_GetRecords = function (IterationIdentifier, MaxReadRecords, callback_func, tag) { obj.Exec("AMT_MessageLog", "GetRecords", { "IterationIdentifier": IterationIdentifier, "MaxReadRecords": MaxReadRecords }, callback_func, tag); } obj.AMT_MessageLog_GetRecord = function (IterationIdentifier, PositionToNext, callback_func) { obj.Exec("AMT_MessageLog", "GetRecord", { "IterationIdentifier": IterationIdentifier, "PositionToNext": PositionToNext }, callback_func); } obj.AMT_MessageLog_PositionAtRecord = function (IterationIdentifier, MoveAbsolute, RecordNumber, callback_func) { obj.Exec("AMT_MessageLog", "PositionAtRecord", { "IterationIdentifier": IterationIdentifier, "MoveAbsolute": MoveAbsolute, "RecordNumber": RecordNumber }, callback_func); } - obj.AMT_MessageLog_PositionToFirstRecord = function (callback_func, tag) { - obj.Exec("AMT_MessageLog", "PositionToFirstRecord", {}, callback_func, tag); } + obj.AMT_MessageLog_PositionToFirstRecord = function (callback_func, tag) { obj.Exec("AMT_MessageLog", "PositionToFirstRecord", {}, callback_func, tag); } obj.AMT_MessageLog_FreezeLog = function (Freeze, callback_func) { obj.Exec("AMT_MessageLog", "FreezeLog", { "Freeze": Freeze }, callback_func); } obj.AMT_PublicKeyManagementService_AddCRL = function (Url, SerialNumbers, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddCRL", { "Url": Url, "SerialNumbers": SerialNumbers }, callback_func); } obj.AMT_PublicKeyManagementService_ResetCRLList = function (_method_dummy, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "ResetCRLList", { "_method_dummy": _method_dummy }, callback_func); } @@ -304,10 +303,7 @@ function AmtStackCreateService(wsmanStack) { obj.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch = function (Ta0, Tm1, Tm2, callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "SetHighAccuracyTimeSynch", { "Ta0": Ta0, "Tm1": Tm1, "Tm2": Tm2 }, callback_func, tag); } obj.AMT_UserInitiatedConnectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_UserInitiatedConnectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); } obj.AMT_WebUIService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func, tag) { obj.Exec("AMT_WebUIService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func, tag); } - obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { - console.log(JSON.stringify({ "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, null, 2)); - obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); - } + obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); } obj.AMT_WiFiPortConfigurationService_UpdateWiFiSettings = function (WiFiEndpointSettings, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "UpdateWiFiSettings", { "WiFiEndpointSettings": WiFiEndpointSettings, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); } obj.AMT_WiFiPortConfigurationService_DeleteAllITProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllITProfiles", { "_method_dummy": _method_dummy }, callback_func); } obj.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllUserProfiles", { "_method_dummy": _method_dummy }, callback_func); } @@ -995,17 +991,21 @@ function AmtStackCreateService(wsmanStack) { var endTag = hasNamespace ? ''; - for (var prop in inInstance) { - if (!inInstance.hasOwnProperty(prop) || prop.indexOf('__') === 0) continue; + if (typeof inInstance == 'string') { + 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') { - //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>'; - console.error('only convert one level down...'); - } - else { - result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>'; + if (typeof inInstance[prop] === 'object') { + //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>'; + console.error('only convert one level down...'); + } + else { + result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>'; + } } } result += ''; diff --git a/amtmanager.js b/amtmanager.js index 738fe125..6cb05108 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -1709,6 +1709,7 @@ module.exports.CreateAmtManager = function (parent) { const wiredConfig = devNetAuthData.wiredConfig; const wirelessConfig = devNetAuthData.wirelessConfig; + var taskCounter = 0; if (wirelessConfig) { // Add missing WIFI profiles var nextPriority = 1; @@ -1748,7 +1749,6 @@ module.exports.CreateAmtManager = function (parent) { if (domain.amtmanager['802.1x'].domain) { netAuthProfile['Domain'] = domain.amtmanager['802.1x'].domain; } if (domain.amtmanager['802.1x'].authenticationprotocol > 3) { domain.amtmanager['ProtectedAccessCredential'] = profileToAdd['802.1x'].protectedaccesscredentialhex; netAuthProfile['PACPassword'] = profileToAdd['802.1x'].pacpassword; } - /* // Setup Client Certificate if (devNetAuthData.certInstanceId) { netAuthSettingsClientCert = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.certInstanceId + ''; @@ -1757,16 +1757,6 @@ module.exports.CreateAmtManager = function (parent) { if (devNetAuthData.rootCertInstanceId) { netAuthSettingsServerCaCert = '/wsman' + dev.amtstack.CompleteName('AMT_PublicKeyCertificate') + '' + devNetAuthData.rootCertInstanceId + ''; } - */ - - // Setup Client Certificate - if (devNetAuthData.certInstanceId) { - netAuthSettingsClientCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + devNetAuthData.certInstanceId + ''; - } - // Setup Server Certificate - if (devNetAuthData.rootCertInstanceId) { - netAuthSettingsServerCaCert = '
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://intel.com/wbem/wscim/1/amt-schema/1/AMT_PublicKeyCertificate' + devNetAuthData.rootCertInstanceId + ''; - } // If we have credentials from MeshCentral Satelite, use that if (dev.netAuthCredentials != null) { @@ -1777,25 +1767,20 @@ module.exports.CreateAmtManager = function (parent) { } } prioritiesInUse.push(nextPriority); // Occupy the priority slot and add the WIFI profile. - console.log('AddWiFiSettings1'); + taskCounter++; dev.amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings(wifiep, wifiepsettinginput, netAuthProfile, netAuthSettingsClientCert, netAuthSettingsServerCaCert, function (stack, name, response, status) { if (status != 200) { dev.consoleMsg("Unable to set WIFI profile."); } - console.log('AddWiFiSettings2', status, response); + if (--taskCounter == 0) { attemptWifiSyncEx2(dev, devNetAuthData); } // All done, complete WIFI configuration }); } - - // Complete WIFI configuration - attemptWifiSyncEx2(dev, devNetAuthData); - } else { - // Done - devTaskCompleted(dev); } + + if (taskCounter == 0) { attemptWifiSyncEx2(dev, devNetAuthData); } // All done, complete WIFI configuration } function attemptWifiSyncEx2(dev, devNetAuthData) { if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request. - const responses = devNetAuthData.responses; // Check if local WIFI profile sync is enabled, if not, enabled it. @@ -1825,8 +1810,6 @@ module.exports.CreateAmtManager = function (parent) { } } - console.log('ALL GOOD'); - // Done devTaskCompleted(dev); } diff --git a/public/scripts/amt-0.2.0.js b/public/scripts/amt-0.2.0.js index 316b07e3..74113bb7 100644 --- a/public/scripts/amt-0.2.0.js +++ b/public/scripts/amt-0.2.0.js @@ -896,20 +896,24 @@ function instanceToXml(instanceName, inInstance) { var startTag = hasNamespace ? ''; - 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] === 'object') { - //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>'; - console.error('only convert one level down...'); - } - else { - result += startTag + prop +'>' + inInstance[prop].toString() + endTag + prop +'>'; - } - } + var result = ''; + if (typeof inInstance == 'string') { + 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] === 'object') { + //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>'; + console.error('only convert one level down...'); + } + else { + result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>'; + } + } + } result += ''; return result; } From 1aa9a2c20c5c782d0514c455d4dc90f65caa41f5 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 7 Apr 2022 12:07:11 -0700 Subject: [PATCH 9/9] Updated MeshCommander --- amtmanager.js | 12 ++-- public/commander-de.htm | 14 ++-- public/commander-es.htm | 14 ++-- public/commander-fr.htm | 14 ++-- public/commander-it.htm | 14 ++-- public/commander-ja.htm | 14 ++-- public/commander-ko.htm | 14 ++-- public/commander-nl.htm | 14 ++-- public/commander-pt.htm | 14 ++-- public/commander-ru.htm | 14 ++-- public/commander-zh-chs.htm | 122 +++++++++++++++---------------- public/commander.htm | 138 ++++++++++++++++++------------------ 12 files changed, 201 insertions(+), 197 deletions(-) diff --git a/amtmanager.js b/amtmanager.js index 6cb05108..8dcc11a3 100644 --- a/amtmanager.js +++ b/amtmanager.js @@ -131,7 +131,7 @@ module.exports.CreateAmtManager = function (parent) { if ((typeof wifiProfile.password != 'string') || (wifiProfile.password.length < 8) || (wifiProfile.password.length > 63)) continue; } else if ([5, 7, 32768, 32769].indexOf(wifiProfile.authentication) >= 0) { // 802.1x authentication - if (domain.amtmanager['802.1x'] == null) continue; + if ((domain.amtmanager['802.1x'] == null) || (typeof domain.amtmanager['802.1x'] != 'object')) continue; } goodWifiProfiles.push(wifiProfile); @@ -1336,7 +1336,7 @@ module.exports.CreateAmtManager = function (parent) { // - // Intel AMT WIFI + // Intel AMT WIFI & Wired 802.1x // // Check which key pair matches the public key in the certificate @@ -1379,7 +1379,7 @@ module.exports.CreateAmtManager = function (parent) { if ((responses['AMT_PublicKeyCertificate'].status != 200) || (responses['AMT_PublicKeyCertificate'].status != 200)) { devTaskCompleted(dev); return; } // We can't get the certificate list, fail and carry on. // See if we need to perform wired or wireless 802.1x configuration - const wiredConfig = ((parent.config.domains[dev.domainid].amtmanager['802.1x'] != null) && (responses['AMT_8021XProfile'].status == 200)); + var wiredConfig = ((parent.config.domains[dev.domainid].amtmanager['802.1x'] != null) && (responses['AMT_8021XProfile'].status == 200)); const wirelessConfig = ((responses['CIM_WiFiEndpointSettings'].status == 200) && (responses['AMT_WiFiPortConfigurationService'].status == 200) && (responses['CIM_WiFiPort'].status == 200) && (responses['CIM_IEEE8021xSettings'].status == 200)); if (!wiredConfig && !wirelessConfig) { devTaskCompleted(dev); return; } // We can't get wired or wireless settings, ignore and carry on. @@ -1519,6 +1519,10 @@ module.exports.CreateAmtManager = function (parent) { } } + // Figure out is there are no changes to 802.1x wired configuration + if ((wiredMatch == 0) && (newNetAuthProfileRequested == false)) { wiredConfig = false; } + + // See if we need to ask MeshCentral Satellite for a new 802.1x profile if (newNetAuthProfileRequested && (typeof srvNetAuthProfile.satellitecredentials == 'string')) { // Credentials for this 802.1x profile are provided using MeshCentral Satellite // Send a message to Satellite requesting a 802.1x profile for this device @@ -1638,7 +1642,7 @@ module.exports.CreateAmtManager = function (parent) { var netAuthProfile = Clone(devNetAuthProfile); netAuthProfile['Enabled'] = ((srvNetAuthProfile != null) && (typeof srvNetAuthProfile == 'object')); if (netAuthProfile['Enabled']) { - netAuthProfile['ActiveInS0'] = (srvNetAuthProfile.availableInS0 !== false); + netAuthProfile['ActiveInS0'] = (srvNetAuthProfile.availableins0 !== false); netAuthProfile['AuthenticationProtocol'] = srvNetAuthProfile.authenticationprotocol; if (srvNetAuthProfile.roamingidentity && (srvNetAuthProfile.roamingidentity != '')) { netAuthProfile['RoamingIdentity'] = srvNetAuthProfile.roamingidentity; } else { delete netAuthProfile['RoamingIdentity']; } if (srvNetAuthProfile.servercertificatename && (srvNetAuthProfile.servercertificatename != '')) { diff --git a/public/commander-de.htm b/public/commander-de.htm index 3f7b127f..c618010f 100644 --- a/public/commander-de.htm +++ b/public/commander-de.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-es.htm b/public/commander-es.htm index cce497fa..31eda3f7 100644 --- a/public/commander-es.htm +++ b/public/commander-es.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-fr.htm b/public/commander-fr.htm index 80b14a94..e0dfd06a 100644 --- a/public/commander-fr.htm +++ b/public/commander-fr.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-it.htm b/public/commander-it.htm index 1fab29ec..bca20c66 100644 --- a/public/commander-it.htm +++ b/public/commander-it.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-ja.htm b/public/commander-ja.htm index 16b10f00..da392da5 100644 --- a/public/commander-ja.htm +++ b/public/commander-ja.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-ko.htm b/public/commander-ko.htm index 8a6b4acc..a959c1b1 100644 --- a/public/commander-ko.htm +++ b/public/commander-ko.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-nl.htm b/public/commander-nl.htm index f608e97c..3a9cd291 100644 --- a/public/commander-nl.htm +++ b/public/commander-nl.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-pt.htm b/public/commander-pt.htm index 1a69072b..591753fe 100644 --- a/public/commander-pt.htm +++ b/public/commander-pt.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-ru.htm b/public/commander-ru.htm index 5ebe5009..36c46544 100644 --- a/public/commander-ru.htm +++ b/public/commander-ru.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; diff --git a/public/commander-zh-chs.htm b/public/commander-zh-chs.htm index 3748bb46..28768d42 100644 --- a/public/commander-zh-chs.htm +++ b/public/commander-zh-chs.htm @@ -56,13 +56,13 @@ e.PendingAjax.shift();b[1](null,a,b[2])}null!=e.websocket&&(e.websocket.close(), function(a,b,n,k,p){d.host=a;d.port=b;d.user=n;d.pass=k;d.connectstate=0;d.inDataCount=0;a=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+p+("*"==n?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+n:"");null!=c&&""!=c&&(a+="&auth="+c);d.socket=new WebSocket(a);d.socket.binaryType="arraybuffer";d.socket.onopen=d.xxOnSocketConnected; d.socket.onmessage=d.xxOnMessage;d.socket.onclose=d.xxOnSocketClosed;d.xxStateChange(1)};d.xxOnSocketConnected=function(){d.xxStateChange(2);1==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,83,79,76,32]));2==d.protocol&&d.directSend(new Uint8Array([16,1,0,0,75,86,77,82]));3==d.protocol&&d.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))};d.xxOnMessage=function(b){if(b.data&&-1!=d.connectstate){d.inDataCount++;if(1==d.connectstate&&(2==d.protocol||3==d.protocol))return d.m.ProcessBinaryData? d.m.ProcessBinaryData(b.data):d.m.ProcessData(a(new Uint8Array(b.data)));if(null==d.acc)d.acc=b.data;else{var c=new Uint8Array(d.acc.byteLength+b.data.byteLength);c.set(new Uint8Array(d.acc),0);c.set(new Uint8Array(b.data),d.acc.byteLength);d.acc=c.buffer}for(;null!=d.acc&&1<=d.acc.byteLength;){b=0;var n=new Uint8Array(d.acc);switch(n[0]){case 17:if(4>n.byteLength)return;switch(n[1]){case 0:if(13>n.byteLength)return;b=n[12];if(n.byteLength<13+b)return;d.directSend(new Uint8Array([19,0,0,0,0,0,0,0, -0]));b=13+b;break;default:d.Stop(1)}break;case 20:if(9>n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+k+String.fromCharCode(p.length)+ -p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10>n.byteLength)break;b=10; -break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8n.byteLength)return;b=(new DataView(d.acc)).getUint32(5,!0);if(n.byteLength<9+b)return;var k=n[1],c=n[4],p=[];for(i=0;iw;w++)B+="abcdef0123456789".charAt(Math.floor(16*Math.random()));w="";4==c&&(e=n[v],e=a(new Uint8Array(n.buffer.slice(v+1,v+1+e))),w="00000002:"+B+":"+e+":");n=hex_md5(hex_md5(d.user+":"+k+":"+d.pass)+":"+p+":"+w+hex_md5("POST:"+d.authuri));v=d.user.length+k.length+p.length+d.authuri.length+B.length+8+n.length+7;4==c&&(v+=e.length+1);n=String.fromCharCode(19,0,0,0,c)+IntToStrX(v)+String.fromCharCode(d.user.length)+d.user+String.fromCharCode(k.length)+ +k+String.fromCharCode(p.length)+p+String.fromCharCode(d.authuri.length)+d.authuri+String.fromCharCode(B.length)+B+String.fromCharCode(8)+"00000002"+String.fromCharCode(n.length)+n;4==c&&(n+=String.fromCharCode(e.length)+e);d.xxSend(n)}break;case 33:if(23>n.byteLength)break;b=23;d.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(d.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==d.protocol&&(d.amtkeepalivetimer=setInterval(d.xxSendAmtKeepAlive,2E3));d.connectstate=1;d.xxStateChange(3);break;case 41:if(10> +n.byteLength)break;b=10;break;case 42:if(10>n.byteLength)break;c=10+(n[9]<<8)+n[8];if(n.byteLengthn.byteLength)break;b=8;break;case 65:if(8>n.byteLength)break;d.connectstate=1;d.m.Start();8'+a.InstanceID+""; @@ -126,33 +126,33 @@ e.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,b){e.Exec "GetProvisioningAuditRecord",{},a)};e.AMT_SetupAndConfigurationService_GetUuid=function(a){e.Exec("AMT_SetupAndConfigurationService","GetUuid",{},a)};e.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){e.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};e.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){e.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};e.AMT_SystemDefensePolicy_GetTimeout= function(a){e.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};e.AMT_SystemDefensePolicy_SetTimeout=function(a,b){e.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:a},b)};e.AMT_SystemDefensePolicy_UpdateStatistics=function(a,b,c,p,d,h){e.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:b},c,p,d,h)};e.AMT_SystemPowerScheme_SetPowerScheme=function(a,b,c){e.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,c,0,{InstanceID:b})};e.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch= function(a,b){e.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,b)};e.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(a,b,c,p,d){e.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:b,Tm2:c},p,d)};e.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,b,c){e.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.AMT_WebUIService_RequestStateChange=function(a,b,c){e.Exec("AMT_WebUIService", -"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,p,d,h){e.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:p,CACredential:d},h)};e.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,b,c,p,d,h){e.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b, -IEEE8021xSettingsInput:c,ClientCredential:p,CACredential:d},h)};e.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:a},b)};e.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},b)};e.CIM_Account_RequestStateChange=function(a,b,c){e.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b}, -c)};e.CIM_AccountManagementService_CreateAccount=function(a,b,c){e.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};e.CIM_BootConfigSetting_ChangeBootOrder=function(a,b){e.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};e.CIM_BootService_SetBootConfigRole=function(a,b,c){e.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:b},c,0,1)};e.CIM_BootService_RequestStateChange=function(a,b,c,p){e.Exec("CIM_BootService","RequestStateChange", -{RequestedState:a,TimeoutPeriod:b},c,p,1)};e.CIM_Card_ConnectorPower=function(a,b,c){e.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};e.CIM_Card_IsCompatible=function(a,b){e.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};e.CIM_Chassis_IsCompatible=function(a,b){e.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)};e.CIM_Fan_SetSpeed=function(a,b){e.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},b)};e.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){e.Exec("CIM_KVMRedirectionSAP", -"RequestStateChange",{RequestedState:a},c)};e.CIM_MediaAccessDevice_LockMedia=function(a,b){e.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};e.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){e.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_MediaAccessDevice_Reset=function(a){e.Exec("CIM_MediaAccessDevice","Reset",{},a)};e.CIM_MediaAccessDevice_EnableDevice=function(a,b){e.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};e.CIM_MediaAccessDevice_OnlineDevice= -function(a,b){e.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};e.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){e.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};e.CIM_MediaAccessDevice_SaveProperties=function(a){e.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};e.CIM_MediaAccessDevice_RestoreProperties=function(a){e.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};e.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){e.Exec("CIM_MediaAccessDevice","RequestStateChange", -{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_PhysicalFrame_IsCompatible=function(a,b){e.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};e.CIM_PhysicalPackage_IsCompatible=function(a,b){e.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};e.CIM_PowerManagementService_RequestPowerStateChange=function(a,b,c,p,d){e.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:p},d,0,1)};e.CIM_PowerSupply_SetPowerState=function(a, -b,c){e.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_PowerSupply_Reset=function(a){e.Exec("CIM_PowerSupply","Reset",{},a)};e.CIM_PowerSupply_EnableDevice=function(a,b){e.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};e.CIM_PowerSupply_OnlineDevice=function(a,b){e.Exec("CIM_PowerSupply","OnlineDevice",{Online:a},b)};e.CIM_PowerSupply_QuiesceDevice=function(a,b){e.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},b)};e.CIM_PowerSupply_SaveProperties=function(a){e.Exec("CIM_PowerSupply", -"SaveProperties",{},a)};e.CIM_PowerSupply_RestoreProperties=function(a){e.Exec("CIM_PowerSupply","RestoreProperties",{},a)};e.CIM_PowerSupply_RequestStateChange=function(a,b,c){e.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_Processor_SetPowerState=function(a,b,c){e.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_Processor_Reset=function(a){e.Exec("CIM_Processor","Reset",{},a)};e.CIM_Processor_EnableDevice=function(a,b){e.Exec("CIM_Processor", -"EnableDevice",{Enabled:a},b)};e.CIM_Processor_OnlineDevice=function(a,b){e.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};e.CIM_Processor_QuiesceDevice=function(a,b){e.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};e.CIM_Processor_SaveProperties=function(a){e.Exec("CIM_Processor","SaveProperties",{},a)};e.CIM_Processor_RestoreProperties=function(a){e.Exec("CIM_Processor","RestoreProperties",{},a)};e.CIM_Processor_RequestStateChange=function(a,b,c){e.Exec("CIM_Processor","RequestStateChange", -{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_RecordLog_ClearLog=function(a){e.Exec("CIM_RecordLog","ClearLog",{},a)};e.CIM_RecordLog_RequestStateChange=function(a,b,c){e.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_RedirectionService_RequestStateChange=function(a,b,c){e.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_Sensor_SetPowerState=function(a,b,c){e.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b}, -c)};e.CIM_Sensor_Reset=function(a){e.Exec("CIM_Sensor","Reset",{},a)};e.CIM_Sensor_EnableDevice=function(a,b){e.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};e.CIM_Sensor_OnlineDevice=function(a,b){e.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};e.CIM_Sensor_QuiesceDevice=function(a,b){e.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:a},b)};e.CIM_Sensor_SaveProperties=function(a){e.Exec("CIM_Sensor","SaveProperties",{},a)};e.CIM_Sensor_RestoreProperties=function(a){e.Exec("CIM_Sensor","RestoreProperties", -{},a)};e.CIM_Sensor_RequestStateChange=function(a,b,c){e.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_StatisticalData_ResetSelectedStats=function(a,b){e.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};e.CIM_Watchdog_KeepAlive=function(a){e.Exec("CIM_Watchdog","KeepAlive",{},a)};e.CIM_Watchdog_SetPowerState=function(a,b,c){e.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_Watchdog_Reset=function(a){e.Exec("CIM_Watchdog", -"Reset",{},a)};e.CIM_Watchdog_EnableDevice=function(a,b){e.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};e.CIM_Watchdog_OnlineDevice=function(a,b){e.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};e.CIM_Watchdog_QuiesceDevice=function(a,b){e.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};e.CIM_Watchdog_SaveProperties=function(a){e.Exec("CIM_Watchdog","SaveProperties",{},a)};e.CIM_Watchdog_RestoreProperties=function(a){e.Exec("CIM_Watchdog","RestoreProperties",{},a)};e.CIM_Watchdog_RequestStateChange= -function(a,b,c){e.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_WiFiPort_SetPowerState=function(a,b,c){e.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_WiFiPort_Reset=function(a){e.Exec("CIM_WiFiPort","Reset",{},a)};e.CIM_WiFiPort_EnableDevice=function(a,b){e.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};e.CIM_WiFiPort_OnlineDevice=function(a,b){e.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},b)};e.CIM_WiFiPort_QuiesceDevice=function(a, -b){e.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};e.CIM_WiFiPort_SaveProperties=function(a){e.Exec("CIM_WiFiPort","SaveProperties",{},a)};e.CIM_WiFiPort_RestoreProperties=function(a){e.Exec("CIM_WiFiPort","RestoreProperties",{},a)};e.CIM_WiFiPort_RequestStateChange=function(a,b,c){e.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_HostBasedSetupService_Setup=function(a,b,c,p,d,h,l){e.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a, -NetworkAdminPassword:b,McNonce:c,Certificate:p,SigningAlgorithm:d,DigitalSignature:h},l)};e.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,p){e.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},p)};e.IPS_HostBasedSetupService_AdminSetup=function(a,b,c,p,d,h){e.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:p,DigitalSignature:d},h)};e.IPS_HostBasedSetupService_UpgradeClientToAdmin= -function(a,b,c,p){e.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},p)};e.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){e.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},b)};e.IPS_KVMRedirectionSettingData_TerminateSession=function(a){e.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){e.Exec("IPS_KVMRedirectionSettingData", -"DataChannelRead",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){e.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};e.IPS_OptInService_StartOptIn=function(a){e.Exec("IPS_OptInService","StartOptIn",{},a)};e.IPS_OptInService_CancelOptIn=function(a){e.Exec("IPS_OptInService","CancelOptIn",{},a)};e.IPS_OptInService_SendOptInCode=function(a,b){e.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)};e.IPS_OptInService_StartService=function(a){e.Exec("IPS_OptInService", -"StartService",{},a)};e.IPS_OptInService_StopService=function(a){e.Exec("IPS_OptInService","StopService",{},a)};e.IPS_OptInService_RequestStateChange=function(a,b,c){e.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_PowerManagementService_RequestOSPowerSavingStateChange=function(a,b,c,p,d){e.Exec("IPS_PowerManagementService","RequestOSPowerSavingStateChange",{OSPowerSavingState:a,ManagedElement:b,Time:c,TimeoutPeriod:p},d,0,1)};e.IPS_ProvisioningRecordLog_RequestStateChange= -function(a,b,c){e.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_ProvisioningRecordLog_ClearLog=function(a,b){e.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};e.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){e.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};e.IPS_SecIOService_RequestStateChange=function(a,b,c){e.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a, -TimeoutPeriod:b},c)};e.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,p,d){e.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:p},d)};e.AmtStatusToStr=function(a){return e.AmtStatusCodes[a]?e.AmtStatusCodes[a]:"UNKNOWN_ERROR"};e.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED", -9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION", -30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY", -1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY", -2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};e.GetMessageLog=function(a,b){e.AMT_MessageLog_PositionToFirstRecord(n, -[a,b,[]])};var E="Unspecified.;No system memory is physically installed in the system.;No usable system memory, all installed memory has experienced an unrecoverable failure.;Unrecoverable hard-disk/ATAPI/IDE device failure.;Unrecoverable system-board failure.;Unrecoverable diskette subsystem failure.;Unrecoverable hard-disk controller failure.;Unrecoverable PS/2 or USB keyboard failure.;Removable boot media not found.;Unrecoverable video controller failure.;No video device detected.;Firmware (BIOS) ROM corruption detected.;CPU voltage mismatch (processors that share same supply have mismatched voltage requirements);CPU speed matching failure".split(";"), +"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,p,d,h){console.log(JSON.stringify({WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:p,CACredential:d},null,2));e.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:p,CACredential:d},h)};e.AMT_WiFiPortConfigurationService_UpdateWiFiSettings= +function(a,b,c,p,d,h){e.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:p,CACredential:d},h)};e.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:a},b)};e.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a}, +b)};e.CIM_Account_RequestStateChange=function(a,b,c){e.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_AccountManagementService_CreateAccount=function(a,b,c){e.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};e.CIM_BootConfigSetting_ChangeBootOrder=function(a,b){e.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};e.CIM_BootService_SetBootConfigRole=function(a,b,c){e.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a, +Role:b},c,0,1)};e.CIM_BootService_RequestStateChange=function(a,b,c,p){e.Exec("CIM_BootService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c,p,1)};e.CIM_Card_ConnectorPower=function(a,b,c){e.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};e.CIM_Card_IsCompatible=function(a,b){e.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};e.CIM_Chassis_IsCompatible=function(a,b){e.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)};e.CIM_Fan_SetSpeed=function(a,b){e.Exec("CIM_Fan", +"SetSpeed",{DesiredSpeed:a},b)};e.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){e.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},c)};e.CIM_MediaAccessDevice_LockMedia=function(a,b){e.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};e.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){e.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_MediaAccessDevice_Reset=function(a){e.Exec("CIM_MediaAccessDevice","Reset",{},a)};e.CIM_MediaAccessDevice_EnableDevice= +function(a,b){e.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};e.CIM_MediaAccessDevice_OnlineDevice=function(a,b){e.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};e.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){e.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};e.CIM_MediaAccessDevice_SaveProperties=function(a){e.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};e.CIM_MediaAccessDevice_RestoreProperties=function(a){e.Exec("CIM_MediaAccessDevice","RestoreProperties", +{},a)};e.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){e.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_PhysicalFrame_IsCompatible=function(a,b){e.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};e.CIM_PhysicalPackage_IsCompatible=function(a,b){e.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};e.CIM_PowerManagementService_RequestPowerStateChange=function(a,b,c,p,d){e.Exec("CIM_PowerManagementService","RequestPowerStateChange", +{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:p},d,0,1)};e.CIM_PowerSupply_SetPowerState=function(a,b,c){e.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_PowerSupply_Reset=function(a){e.Exec("CIM_PowerSupply","Reset",{},a)};e.CIM_PowerSupply_EnableDevice=function(a,b){e.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};e.CIM_PowerSupply_OnlineDevice=function(a,b){e.Exec("CIM_PowerSupply","OnlineDevice",{Online:a},b)};e.CIM_PowerSupply_QuiesceDevice=function(a,b){e.Exec("CIM_PowerSupply", +"QuiesceDevice",{Quiesce:a},b)};e.CIM_PowerSupply_SaveProperties=function(a){e.Exec("CIM_PowerSupply","SaveProperties",{},a)};e.CIM_PowerSupply_RestoreProperties=function(a){e.Exec("CIM_PowerSupply","RestoreProperties",{},a)};e.CIM_PowerSupply_RequestStateChange=function(a,b,c){e.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_Processor_SetPowerState=function(a,b,c){e.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_Processor_Reset=function(a){e.Exec("CIM_Processor", +"Reset",{},a)};e.CIM_Processor_EnableDevice=function(a,b){e.Exec("CIM_Processor","EnableDevice",{Enabled:a},b)};e.CIM_Processor_OnlineDevice=function(a,b){e.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};e.CIM_Processor_QuiesceDevice=function(a,b){e.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};e.CIM_Processor_SaveProperties=function(a){e.Exec("CIM_Processor","SaveProperties",{},a)};e.CIM_Processor_RestoreProperties=function(a){e.Exec("CIM_Processor","RestoreProperties",{},a)};e.CIM_Processor_RequestStateChange= +function(a,b,c){e.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_RecordLog_ClearLog=function(a){e.Exec("CIM_RecordLog","ClearLog",{},a)};e.CIM_RecordLog_RequestStateChange=function(a,b,c){e.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_RedirectionService_RequestStateChange=function(a,b,c){e.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_Sensor_SetPowerState=function(a, +b,c){e.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_Sensor_Reset=function(a){e.Exec("CIM_Sensor","Reset",{},a)};e.CIM_Sensor_EnableDevice=function(a,b){e.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};e.CIM_Sensor_OnlineDevice=function(a,b){e.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};e.CIM_Sensor_QuiesceDevice=function(a,b){e.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:a},b)};e.CIM_Sensor_SaveProperties=function(a){e.Exec("CIM_Sensor","SaveProperties",{},a)};e.CIM_Sensor_RestoreProperties= +function(a){e.Exec("CIM_Sensor","RestoreProperties",{},a)};e.CIM_Sensor_RequestStateChange=function(a,b,c){e.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_StatisticalData_ResetSelectedStats=function(a,b){e.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};e.CIM_Watchdog_KeepAlive=function(a){e.Exec("CIM_Watchdog","KeepAlive",{},a)};e.CIM_Watchdog_SetPowerState=function(a,b,c){e.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b}, +c)};e.CIM_Watchdog_Reset=function(a){e.Exec("CIM_Watchdog","Reset",{},a)};e.CIM_Watchdog_EnableDevice=function(a,b){e.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};e.CIM_Watchdog_OnlineDevice=function(a,b){e.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};e.CIM_Watchdog_QuiesceDevice=function(a,b){e.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};e.CIM_Watchdog_SaveProperties=function(a){e.Exec("CIM_Watchdog","SaveProperties",{},a)};e.CIM_Watchdog_RestoreProperties=function(a){e.Exec("CIM_Watchdog", +"RestoreProperties",{},a)};e.CIM_Watchdog_RequestStateChange=function(a,b,c){e.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.CIM_WiFiPort_SetPowerState=function(a,b,c){e.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};e.CIM_WiFiPort_Reset=function(a){e.Exec("CIM_WiFiPort","Reset",{},a)};e.CIM_WiFiPort_EnableDevice=function(a,b){e.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};e.CIM_WiFiPort_OnlineDevice=function(a,b){e.Exec("CIM_WiFiPort","OnlineDevice", +{Online:a},b)};e.CIM_WiFiPort_QuiesceDevice=function(a,b){e.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};e.CIM_WiFiPort_SaveProperties=function(a){e.Exec("CIM_WiFiPort","SaveProperties",{},a)};e.CIM_WiFiPort_RestoreProperties=function(a){e.Exec("CIM_WiFiPort","RestoreProperties",{},a)};e.CIM_WiFiPort_RequestStateChange=function(a,b,c){e.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_HostBasedSetupService_Setup=function(a,b,c,p,d,h,l){e.Exec("IPS_HostBasedSetupService", +"Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,Certificate:p,SigningAlgorithm:d,DigitalSignature:h},l)};e.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,p){e.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},p)};e.IPS_HostBasedSetupService_AdminSetup=function(a,b,c,p,d,h){e.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:p, +DigitalSignature:d},h)};e.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,b,c,p){e.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},p)};e.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){e.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},b)};e.IPS_KVMRedirectionSettingData_TerminateSession=function(a){e.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelRead= +function(a){e.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){e.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};e.IPS_OptInService_StartOptIn=function(a){e.Exec("IPS_OptInService","StartOptIn",{},a)};e.IPS_OptInService_CancelOptIn=function(a){e.Exec("IPS_OptInService","CancelOptIn",{},a)};e.IPS_OptInService_SendOptInCode=function(a,b){e.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)}; +e.IPS_OptInService_StartService=function(a){e.Exec("IPS_OptInService","StartService",{},a)};e.IPS_OptInService_StopService=function(a){e.Exec("IPS_OptInService","StopService",{},a)};e.IPS_OptInService_RequestStateChange=function(a,b,c){e.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_PowerManagementService_RequestOSPowerSavingStateChange=function(a,b,c,p,d){e.Exec("IPS_PowerManagementService","RequestOSPowerSavingStateChange",{OSPowerSavingState:a,ManagedElement:b, +Time:c,TimeoutPeriod:p},d,0,1)};e.IPS_ProvisioningRecordLog_RequestStateChange=function(a,b,c){e.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_ProvisioningRecordLog_ClearLog=function(a,b){e.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};e.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){e.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};e.IPS_SecIOService_RequestStateChange= +function(a,b,c){e.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};e.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,p,d){e.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:p},d)};e.AmtStatusToStr=function(a){return e.AmtStatusCodes[a]?e.AmtStatusCodes[a]:"UNKNOWN_ERROR"};e.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE", +6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED", +26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY", +47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH", +2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD", +4106:"URL_REQUIRED"};e.GetMessageLog=function(a,b){e.AMT_MessageLog_PositionToFirstRecord(n,[a,b,[]])};var E="Unspecified.;No system memory is physically installed in the system.;No usable system memory, all installed memory has experienced an unrecoverable failure.;Unrecoverable hard-disk/ATAPI/IDE device failure.;Unrecoverable system-board failure.;Unrecoverable diskette subsystem failure.;Unrecoverable hard-disk controller failure.;Unrecoverable PS/2 or USB keyboard failure.;Removable boot media not found.;Unrecoverable video controller failure.;No video device detected.;Firmware (BIOS) ROM corruption detected.;CPU voltage mismatch (processors that share same supply have mismatched voltage requirements);CPU speed matching failure".split(";"), m="Unspecified.;Memory initialization.;Starting hard-disk initialization and test;Secondary processor(s) initialization;User authentication;Entering BIOS setup;USB resource configuration;PCI resource configuration;Option ROM initialization;Video initialization;Cache initialization;SM Bus initialization;Keyboard controller initialization;Embedded controller/management controller initialization;Docking station attachment;Enabling docking station;Docking station ejection;Disabling docking station;Calling operating system wake-up vector;Starting operating system boot process;Baseboard or motherboard initialization;reserved;Floppy initialization;Keyboard test;Pointing device test;Primary processor initialization".split(";"), l="Unspecified;Other;Unknown;Processor;Disk;Peripheral;System management module;System board;Memory module;Processor module;Power supply;Add in card;Front panel board;Back panel board;Power system board;Drive backplane;System internal expansion board;Other system board;Processor board;Power unit;Power module;Power management board;Chassis back panel board;System chassis;Sub chassis;Other chassis board;Disk drive bay;Peripheral bay;Device bay;Fan cooling;Cooling unit;Cable interconnect;Memory device;System management software;BIOS;Intel(r) ME;System bus;Group;Intel(r) ME;External environment;Battery;Processing blade;Connectivity switch;Processor/memory module;I/O module;Processor I/O module;Management controller firmware;IPMI channel;PCI bus;PCI express bus;SCSI bus;SATA/SAS bus;Processor front side bus".split(";"); e.RealmNames=";;Redirection;;Hardware Asset;Remote Control;Storage;Event Manager;Storage Admin;Agent Presence Local;Agent Presence Remote;Circuit Breaker;Network Time;General Information;Firmware Update;EIT;LocalUN;Endpoint Access Control;Endpoint Access Control Admin;Event Log Reader;Audit Log;ACL Realm;;;Local System".split(";");e.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var h="Boot parameters received from CSME;CSME Boot Option % added successfully;HTTPS URI name resolved;HTTPS connected successfully;HTTPSBoot download is completed;Attempt to boot;Exit boot services".split(";"), @@ -212,14 +212,14 @@ function(a,b){for(var c="",p="",e,d,h,l=0;l>4,64!==l&&(p[r++]=(h&15)<<4|l>>2,64!==m&&(p[r++]=(l&3)<<6|m));return b?r-c:p.subarray(0,r)};e.text={utf8:{},utf16:{}};e.text.utf8.encode=function(a,b,c){a=e.encodeUtf8(a); var p=b;p||(p=new Uint8Array(a.length));for(var d=c=c||0,h=0;h");break;case "%":d.push("%");break;default:d.push("<#"+ -c+"?>")}d.push(a.substring(p));return d.join("")};e.formatNumber=function(a,b,c,p){var e=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;p=void 0===p?".":p;c=0>a?"-":"";var d=parseInt(a=Math.abs(+a||0).toFixed(e),10)+"",h=3");break;case "%":e.push("%");break;default:e.push("<#"+ +c+"?>")}e.push(a.substring(p));return e.join("")};e.formatNumber=function(a,b,c,p){var d=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;p=void 0===p?".":p;c=0>a?"-":"";var e=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",h=3d;++d)if(a[d]&&0!==a[d].length){var h=e.hexToBytes(a[d]);2>h.length&&p.putByte(0);p.putBytes(h)}else p.fillWithByte(0,c),c=0;return p.getBytes()};e.bytesToIP=function(a){return 4===a.length?e.bytesToIPv4(a):16===a.length?e.bytesToIPv6(a):null};e.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;cc[p].end-c[p].start&&(p=c.length-1)):c.push({start:m,end:m})}b.push(h)}0>>1,d=Array(c);d[p]=a.slice(0);for(var e=p>>>1;0>=1;for(e=2;eb;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;h=Array(256);r=Array(256);C=Array(4);x=Array(4);for(b=0;4>b;++b)C[b]=Array(256),x[b]=Array(256);for(var c=0,p=0,e,l,g,v,q,b=0;256>b;++b){v=p^p<<1^p<<2^p<<3^p<<4;v=v>>8^v&255^99;h[c]=v;r[v]=c;q=a[v];e=a[c];l=a[e];g=a[l];q^=q<<24^v<<16^v<<8^v;l=(e^l^g)<<24^(c^ -g)<<16^(c^l^g)<<8^c^e^g;for(var w=0;4>w;++w)C[w][c]=q,x[w][v]=l,q=q<<24|q>>>8,l=l<<24|l>>>8;0===c?c=p=1:(c=e^a[a[a[e^g]]],p^=a[a[p]])}}function g(a,b){for(var c=a.slice(0),p,d=1,e=c.length,m=l*(e+6+1),r=e;r>>16&255]<<24^h[p>>>8&255]<<16^h[p&255]<<8^h[p>>>24]^O[d]<<24,d++):6>>24]<<24^h[p>>>16&255]<<16^h[p>>>8&255]<<8^h[p&255]),c[r]=c[r-e]^p;if(b){for(var d=x[0],e=x[1],v=x[2],w=x[3],k=c.slice(0),m=c.length,r=0,L=m-l;r>>24]]^e[h[p>>>16&255]]^v[h[p>>>8&255]]^w[h[p&255]];c=k}return c}function w(a,b,c,p){var d=a.length/4-1,e,l,g,m,v;p?(e=x[0],l=x[1],g=x[2],m=x[3],v=r):(e=C[0],l=C[1],g=C[2],m=C[3],v=h);var w,k,B,K,E,O;w=b[0]^a[0];k=b[p?3:1]^a[1];B=b[2]^a[2];b=b[p?1:3]^a[3];for(var n=3,u=1;u>>24]^l[k>>>16&255]^g[B>>>8&255]^m[b&255]^a[++n],E=e[k>>>24]^l[B>>>16&255]^g[b>>>8&255]^m[w&255]^a[++n],O=e[B>>>24]^ -l[b>>>16&255]^g[w>>>8&255]^m[k&255]^a[++n],b=e[b>>>24]^l[w>>>16&255]^g[k>>>8&255]^m[B&255]^a[++n],w=K,k=E,B=O;c[0]=v[w>>>24]<<24^v[k>>>16&255]<<16^v[B>>>8&255]<<8^v[b&255]^a[++n];c[p?3:1]=v[k>>>24]<<24^v[B>>>16&255]<<16^v[b>>>8&255]<<8^v[w&255]^a[++n];c[2]=v[B>>>24]<<24^v[b>>>16&255]<<16^v[w>>>8&255]<<8^v[k&255]^a[++n];c[p?1:3]=v[b>>>24]<<24^v[w>>>16&255]<<16^v[k>>>8&255]<<8^v[B&255]^a[++n]}function k(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key): -a.cipher.createCipher(c,b.key);var e=d.start;d.start=function(b,c){var h=null;c instanceof a.util.ByteBuffer&&(h=c,c={});c=c||{};c.output=h;c.iv=b;e.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,p){a=k({key:a,output:c,decrypt:!1,mode:p});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return k({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,p){a=k({key:a,output:c,decrypt:!0,mode:p});a.start(b);return a};a.aes.createDecryptionCipher= +g)<<16^(c^l^g)<<8^c^e^g;for(var w=0;4>w;++w)C[w][c]=q,x[w][v]=l,q=q<<24|q>>>8,l=l<<24|l>>>8;0===c?c=p=1:(c=e^a[a[a[e^g]]],p^=a[a[p]])}}function g(a,b){for(var c=a.slice(0),d,p=1,e=c.length,m=l*(e+6+1),r=e;r>>16&255]<<24^h[d>>>8&255]<<16^h[d&255]<<8^h[d>>>24]^O[p]<<24,p++):6>>24]<<24^h[d>>>16&255]<<16^h[d>>>8&255]<<8^h[d&255]),c[r]=c[r-e]^d;if(b){for(var p=x[0],e=x[1],v=x[2],w=x[3],k=c.slice(0),m=c.length,r=0,L=m-l;r>>24]]^e[h[d>>>16&255]]^v[h[d>>>8&255]]^w[h[d&255]];c=k}return c}function w(a,b,c,d){var p=a.length/4-1,e,l,g,m,v;d?(e=x[0],l=x[1],g=x[2],m=x[3],v=r):(e=C[0],l=C[1],g=C[2],m=C[3],v=h);var w,k,B,K,E,O;w=b[0]^a[0];k=b[d?3:1]^a[1];B=b[2]^a[2];b=b[d?1:3]^a[3];for(var n=3,u=1;u>>24]^l[k>>>16&255]^g[B>>>8&255]^m[b&255]^a[++n],E=e[k>>>24]^l[B>>>16&255]^g[b>>>8&255]^m[w&255]^a[++n],O=e[B>>>24]^ +l[b>>>16&255]^g[w>>>8&255]^m[k&255]^a[++n],b=e[b>>>24]^l[w>>>16&255]^g[k>>>8&255]^m[B&255]^a[++n],w=K,k=E,B=O;c[0]=v[w>>>24]<<24^v[k>>>16&255]<<16^v[B>>>8&255]<<8^v[b&255]^a[++n];c[d?3:1]=v[k>>>24]<<24^v[B>>>16&255]<<16^v[b>>>8&255]<<8^v[w&255]^a[++n];c[2]=v[B>>>24]<<24^v[b>>>16&255]<<16^v[w>>>8&255]<<8^v[k&255]^a[++n];c[d?1:3]=v[b>>>24]<<24^v[w>>>16&255]<<16^v[k>>>8&255]<<8^v[B&255]^a[++n]}function k(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key): +a.cipher.createCipher(c,b.key);var e=d.start;d.start=function(b,c){var h=null;c instanceof a.util.ByteBuffer&&(h=c,c={});c=c||{};c.output=h;c.iv=b;e.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,d){a=k({key:a,output:c,decrypt:!1,mode:d});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return k({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,d){a=k({key:a,output:c,decrypt:!0,mode:d});a.start(b);return a};a.aes.createDecryptionCipher= function(a,b){return k({key:a,output:null,decrypt:!0,mode:b})};a.aes.Algorithm=function(a,b){m||d();var c=this;c.name=a;c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return w(c._w,a,b,!1)},decrypt:function(a,b){return w(c._w,a,b,!0)}}});c._init=!1};a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c=b.key,d;if("string"===typeof c&&(16===c.length||24===c.length||32===c.length))c=a.util.createBuffer(c);else if(a.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){d= c;for(var c=a.util.createBuffer(),e=0;e>>=2,e=0;e>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a.data[c]+=this.m.am(0,d,a,b,0,this.m.t);a.data[c]>=a.DV;)a.data[c]-=a.DV,a.data[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};u.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};u.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};c.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a.data[b]=this.data[b];a.t=this.t;a.s=this.s}; c.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0a?this.data[0]=a+this.DV:this.t=0};c.prototype.fromString=function(a,b){var d;if(16==b)d=4;else if(8==b)d=3;else if(256==b)d=8;else if(2==b)d=1;else if(32==b)d=5;else if(4==b)d=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var e=a.length,p=!1,g=0;0<=--e;){var h=8==d?a[e]&255:m(a,e);0>h?"-"==a.charAt(e)&&(p=!0):(p=!1,0==g?this.data[this.t++]=h:g+d>this.DB?(this.data[this.t-1]|=(h&(1<>this.DB-g):this.data[this.t-1]|=h<=this.DB&&(g-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0>d|g,g=(this.data[h]&e)<=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,p=(1<>d;for(var g= -c+1;g>d;0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b.data[c++]=this.DV+d:0=b.DV&&(a.data[c+b.t]-=b.DV,a.data[c+b.t+1]=1)}0=g.t)){var y=this.abs();if(y.t>this.F2:0),q=this.FV/D,D=(1<k&&c.ZERO.subTo(p,p)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2- -(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0a)return c.ONE;var p=d(),g=d(),y=b.convert(this),l=h(a)-1;for(y.copyTo(p);0<=--l;)if(b.sqrTo(p,g),0<(a&1<this.s)return"-"+this.negate().toString(a);if(16==a)a= -4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>g)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=p;)g>(g+=this.DB-a)):(c=this.data[p]>>(g-=a)&b,0>=g&&(g+=this.DB,--p)),0>d|p,p=(this.data[h]&e)<=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<>d;for(var p= +c+1;p>d;0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b.data[c++]=this.DV+d:0=b.DV&&(a.data[c+b.t]-=b.DV,a.data[c+b.t+1]=1)}0=p.t)){var y=this.abs();if(y.t>this.F2:0),q=this.FV/D,D=(1<k&&c.ZERO.subTo(g,g)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2- +(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0a)return c.ONE;var g=d(),p=d(),y=b.convert(this),l=h(a)-1;for(y.copyTo(g);0<=--l;)if(b.sqrTo(g,p),0<(a&1<this.s)return"-"+this.negate().toString(a);if(16==a)a= +4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>p)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=g;)p>(p+=this.DB-a)):(c=this.data[g]>>(p-=a)&b,0>=p&&(p+=this.DB,--g)),0this.s?this.negate():this};c.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this.data[c]-a.data[c]))return b;return 0};c.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+h(this.data[this.t-1]^this.s&this.DM)};c.prototype.mod=function(a){var b=d();this.abs().divRemTo(a,null,b);0>this.s&&0a||b.isEven()?new r(b):new u(b);return this.exp(a,c)};c.ZERO=l(0);c.ONE=l(1);R.prototype.convert=y;R.prototype.revert=y;R.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};R.prototype.sqrTo=function(a,b){a.squareTo(b)};D.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=d();a.copyTo(b);this.reduce(b);return b};D.prototype.revert=function(a){return a};D.prototype.reduce=function(a){a.drShiftTo(this.m.t- 1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};D.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var N=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109, 113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],U=67108864/N[N.length-1];c.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};c.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36l?"-"==a.charAt(y)&&0==this.signum()&&(p=!0):(h=b*h+l,++g>=d&&(this.dMultiply(e),this.dAddOffset(h,0),h=g=0))}0a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),x,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0>=this.DB;if(a.tl?"-"==a.charAt(y)&&0==this.signum()&&(g=!0):(h=b*h+l,++p>=d&&(this.dMultiply(e),this.dAddOffset(h,0),h=p=0))}0a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),x,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=0>d?-1:0;0d&&(b.data[c++]=this.DV+d);b.t=c;b.clamp()};c.prototype.dMultiply=function(a){this.data[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};c.prototype.dAddOffset=function(a,b){if(0!=a){for(;this.t<=b;)this.data[this.t++]=0;for(this.data[b]+=a;this.data[b]>=this.DV;)this.data[b]-=this.DV,++b>=this.t&&(this.data[this.t++]= 0),++this.data[b]}};c.prototype.multiplyLowerTo=function(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;0=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0=d)return!1;for(var e=b.shiftRight(d),p=G(),g,h=0;h=g.compareTo(c.ONE)||0<=g.compareTo(b));g=g.modPow(e,this);if(0!=g.compareTo(c.ONE)&&0!=g.compareTo(b)){for(var y=1;y++this.s){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24};c.prototype.shortValue= +c)};c.prototype.modInt=function(a){if(0>=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0=d)return!1;for(var e=b.shiftRight(d),g=G(),p,h=0;h=p.compareTo(c.ONE)||0<=p.compareTo(b));p=p.modPow(e,this);if(0!=p.compareTo(c.ONE)&&0!=p.compareTo(b)){for(var y=1;y++this.s){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24};c.prototype.shortValue= function(){return 0==this.t?this.s:this.data[0]<<16>>16};c.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this.data[0]?0:1};c.prototype.toByteArray=function(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(0>c)!=(this.s&this.DM)>>c&&(b[e++]=d|this.s<c?(d=(this.data[a]&(1<>(c+=this.DB-8)):(d=this.data[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0!=(d&128)&&(d|=-256),0==e&& (this.s&128)!=(d&128)&&++e,0this.compareTo(a)?this:a};c.prototype.max=function(a){return 0a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};c.prototype.shiftRight=function(a){var b=d();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};c.prototype.getLowestSetBit=function(){for(var a=0;a>=16,c+=16); 0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};c.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c=this.t?0!=this.s:0!=(this.data[b]&1<=c)return g;p=18>c?1:48>c?3:144>c?4:768>c?5:6;y=8>c?new r(b):b.isEven()?new D(b):new u(b);var k=[],m=3,q=p-1,A=(1<=q?x=a.data[v]>>c-q&A:(x=(a.data[v]&(1<>this.DB+c-q));for(m=p;0==(x&1);)x>>=1,--m;0>(c-=m)&&(c+=this.DB,--v); -if(G)k[x].copyTo(g),G=!1;else{for(;1--c&&(c=this.DB-1,--v)}return y.revert(g)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),p=l(1),g=l(0),h=l(0),y=l(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(p.isEven()&&g.isEven()||(p.addTo(this,p),g.subTo(a,g)),p.rShiftTo(1, -p)):g.isEven()||g.subTo(a,g),g.rShiftTo(1,g);for(;e.isEven();)e.rShiftTo(1,e),b?(h.isEven()&&y.isEven()||(h.addTo(this,h),y.subTo(a,y)),h.rShiftTo(1,h)):y.isEven()||y.subTo(a,y),y.rShiftTo(1,y);0<=d.compareTo(e)?(d.subTo(e,d),b&&p.subTo(h,p),g.subTo(y,g)):(e.subTo(d,e),b&&h.subTo(p,h),y.subTo(g,y))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=y.compareTo(a))return y.subtract(a);if(0>y.signum())y.addTo(a,y);else return y;return 0>y.signum()?y.add(a):y};c.prototype.pow=function(a){return this.exp(a, +c);return[b,c]};c.prototype.modPow=function(a,b){var c=a.bitLength(),g,p=l(1),y;if(0>=c)return p;g=18>c?1:48>c?3:144>c?4:768>c?5:6;y=8>c?new r(b):b.isEven()?new D(b):new u(b);var k=[],m=3,q=g-1,A=(1<=q?x=a.data[v]>>c-q&A:(x=(a.data[v]&(1<>this.DB+c-q));for(m=g;0==(x&1);)x>>=1,--m;0>(c-=m)&&(c+=this.DB,--v); +if(G)k[x].copyTo(p),G=!1;else{for(;1--c&&(c=this.DB-1,--v)}return y.revert(p)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),g=l(1),p=l(0),h=l(0),y=l(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&p.isEven()||(g.addTo(this,g),p.subTo(a,p)),g.rShiftTo(1, +g)):p.isEven()||p.subTo(a,p),p.rShiftTo(1,p);for(;e.isEven();)e.rShiftTo(1,e),b?(h.isEven()&&y.isEven()||(h.addTo(this,h),y.subTo(a,y)),h.rShiftTo(1,h)):y.isEven()||y.subTo(a,y),y.rShiftTo(1,y);0<=d.compareTo(e)?(d.subTo(e,d),b&&g.subTo(h,g),p.subTo(y,p)):(e.subTo(d,e),b&&h.subTo(g,h),y.subTo(p,y))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=y.compareTo(a))return y.subtract(a);if(0>y.signum())y.addTo(a,y);else return y;return 0>y.signum()?y.add(a):y};c.prototype.pow=function(a){return this.exp(a, new R)};c.prototype.gcd=function(a){var b=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c
  
Disconnected