diff --git a/.github/workflows/build-openssl-windows.yml b/.github/workflows/build-openssl-windows.yml index 471ca76d..39842785 100644 --- a/.github/workflows/build-openssl-windows.yml +++ b/.github/workflows/build-openssl-windows.yml @@ -50,9 +50,18 @@ jobs: VERSION="${{ github.event.inputs.openssl_version || '3.5.4' }}" BUILD_DIR="openssl-build-${{ matrix.arch.name }}-${{ matrix.config.suffix }}" curl -L "https://github.com/openssl/openssl/releases/download/openssl-$VERSION/openssl-$VERSION.tar.gz" -o openssl.tar.gz + curl -L "https://github.com/openssl/openssl/releases/download/openssl-$VERSION/openssl-$VERSION.tar.gz.sha256" -o openssl.tar.gz.sha256 + EXPECTED_SHA256="$(cat openssl.tar.gz.sha256 | tr -d '[:space:]')" + ACTUAL_SHA256="$(sha256sum openssl.tar.gz | awk '{print $1}')" + if [ -z "$EXPECTED_SHA256" ] || [ "$EXPECTED_SHA256" != "$ACTUAL_SHA256" ]; then + echo "Checksum verification failed for openssl-$VERSION.tar.gz" + echo "Expected: $EXPECTED_SHA256" + echo "Actual: $ACTUAL_SHA256" + exit 1 + fi mkdir -p "$BUILD_DIR" tar -xzf openssl.tar.gz -C "$BUILD_DIR" --strip-components=1 - rm openssl.tar.gz + rm openssl.tar.gz openssl.tar.gz.sha256 - name: Configure OpenSSL shell: cmd @@ -185,3 +194,4 @@ jobs: name: build-report path: BUILD_REPORT.md retention-days: 90 + diff --git a/meshcore/KVM/MacOS/mac_tile.h b/meshcore/KVM/MacOS/mac_tile.h index 9541c976..a60225bd 100644 --- a/meshcore/KVM/MacOS/mac_tile.h +++ b/meshcore/KVM/MacOS/mac_tile.h @@ -7,8 +7,8 @@ * */ -#ifndef LINUX_TILE_H_ -#define LINUX_TILE_H_ +#ifndef MAC_TILE_H_ +#define MAC_TILE_H_ #include #include @@ -37,5 +37,6 @@ extern int getScreenBuffer(unsigned char **desktop, long long *desktopsize, CGIm extern void set_tile_compression(int type, int level); -#endif /* LINUX_TILE_H_ */ +#endif /* MAC_TILE_H_ */ + diff --git a/microstack/ILibMulticastSocket.c b/microstack/ILibMulticastSocket.c index 21b5ad65..90641df5 100644 --- a/microstack/ILibMulticastSocket.c +++ b/microstack/ILibMulticastSocket.c @@ -214,7 +214,7 @@ void ILibMulticastSocket_BroadcastUdpPacketV4(struct ILibMulticastSocket_StateMo #ifndef NACL if (module->UDPServers[i] != NULL) { - socket = ILibAsyncUDPSocket_GetSocket(module->UDPServer); + socket = ILibAsyncUDPSocket_GetSocket(module->UDPServers[i]); setsockopt(socket, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&(module->AddressListV4[i].sin_addr), sizeof(struct in_addr)); setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&(module->TTL), sizeof(int)); for (j = 0; j < count; j++) sendto(socket, data, datalen, 0, (struct sockaddr*)addr, sizeof(struct sockaddr_in)); @@ -397,3 +397,4 @@ void ILibMulticastSocket_WakeOnLan(void *module, char* mac) ILibMulticastSocket_Broadcast((struct ILibMulticastSocket_StateModule*)module, ILibScratchPad, 102, 1); } } + diff --git a/modules/RecoveryCore.js b/modules/RecoveryCore.js index aedef9dd..fafeae92 100644 --- a/modules/RecoveryCore.js +++ b/modules/RecoveryCore.js @@ -17,7 +17,10 @@ function getOpenFrameMachineId() { ? '/Library/Application Support/OpenFrame/machine_id' : '/var/lib/openframe/machine_id'); openframeMachineId = fs.readFileSync(machineIdPath).toString().trim(); - } catch (ex) { openframeMachineId = null; } + } catch (ex) { + openframeMachineId = null; + try { sendConsoleText('getOpenFrameMachineId error: ' + ex); } catch (ex2) { console.log('getOpenFrameMachineId error: ' + ex); } + } return openframeMachineId; } @@ -502,3 +505,4 @@ function deleteFolderRecursive(path, rec) { fs.unlinkSync(path); } }; + diff --git a/modules/amt-xml.js b/modules/amt-xml.js index cf82c02c..5e59cea1 100644 --- a/modules/amt-xml.js +++ b/modules/amt-xml.js @@ -70,42 +70,6 @@ function _ParseWsmanRec(node) { return r; } -function _PutObjToBodyXml(resuri, putObj) { - if (!resuri || putObj == null) return ''; - var objname = obj.GetNameFromUrl(resuri); - var result = ''; - - for (var prop in putObj) { - if (!putObj.hasOwnProperty(prop) || prop.indexOf('__') === 0 || prop.indexOf('@') === 0) continue; - if (putObj[prop] == null || typeof putObj[prop] === 'function') continue; - if (typeof putObj[prop] === 'object' && putObj[prop]['ReferenceParameters']) { - result += '' + putObj[prop].Address + '' + putObj[prop]['ReferenceParameters']["ResourceURI"] + ''; - var selectorArray = putObj[prop]['ReferenceParameters']['SelectorSet']['Selector']; - if (Array.isArray(selectorArray)) { - for (var i = 0; i < selectorArray.length; i++) { - result += '' + selectorArray[i]['Value'] + ''; - } - } - else { - result += '' + selectorArray['Value'] + ''; - } - result += ''; - } - else { - if (Array.isArray(putObj[prop])) { - for (var i = 0; i < putObj[prop].length; i++) { - result += '' + putObj[prop][i].toString() + ''; - } - } else { - result += '' + putObj[prop].toString() + ''; - } - } - } - - result += ''; - return result; -} - // This is a drop-in replacement to _turnToXml() that works without xml parser dependency. function _treeBuilder() { this.tree = []; @@ -187,3 +151,4 @@ function _turnToXmlRec(text) { } catch (ex) { return null; } return lastElement; } + diff --git a/modules/amt_heci.js b/modules/amt_heci.js index 7f51b0c6..24d1088c 100644 --- a/modules/amt_heci.js +++ b/modules/amt_heci.js @@ -262,32 +262,32 @@ function amt_heci() { fn.apply(this, opt); }, callback, optional); } - this.startConfiguration = function () { + this.startConfiguration = function (data, callback) { var optional = []; for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } this.sendCommand(0x29, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.stopConfiguration = function () { + this.stopConfiguration = function (data, callback) { var optional = []; for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } this.sendCommand(0x5E, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.openUserInitiatedConnection = function () { + this.openUserInitiatedConnection = function (data, callback) { var optional = []; for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } this.sendCommand(0x44, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.closeUserInitiatedConnection = function () { + this.closeUserInitiatedConnection = function (data, callback) { var optional = []; for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } this.sendCommand(0x45, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.getRemoteAccessConnectionStatus = function () { + this.getRemoteAccessConnectionStatus = function (data, callback) { var optional = []; for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } this.sendCommand(0x46, data, function (header, fn, opt) { if (header.Status == 0) { - var hostname = v.slice(14, header.Data.readUInt16LE(12) + 14).toString() + var hostname = header.Data.slice(14, header.Data.readUInt16LE(12) + 14).toString() opt.unshift({ status: header.Status, networkStatus: header.Data.readUInt32LE(0), remoteAccessStatus: header.Data.readUInt32LE(4), remoteAccessTrigger: header.Data.readUInt32LE(8), mpsHostname: hostname, raw: header.Data }); } else { opt.unshift({ status: header.Status }); @@ -297,7 +297,7 @@ function amt_heci() { } this.getProtocolVersion = function (callback) { var optional = []; - for (var i = 1; i < arguments.length; ++i) { opt.push(arguments[i]); } + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } heci.doIoctl(heci.IOCTL.HECI_VERSION, Buffer.alloc(5), Buffer.alloc(5), function (status, buffer, self, fn, opt) { if (status == 0) { @@ -313,4 +313,4 @@ function amt_heci() { } } -module.exports = amt_heci; \ No newline at end of file +module.exports = amt_heci; diff --git a/modules/lme_heci.js b/modules/lme_heci.js index 47343cab..e5f0a76c 100644 --- a/modules/lme_heci.js +++ b/modules/lme_heci.js @@ -141,7 +141,7 @@ function lme_heci() break; case APF_SERVICE_REQUEST: var nameLen = chunk.readUInt32BE(1); - var name = chunk.slice(5, nameLen + 5); + var name = chunk.slice(5, nameLen + 5).toString(); //console.log("Service Request for: " + name); if (name == 'pfwd@amt.intel.com' || name == 'auth@amt.intel.com') { @@ -353,3 +353,4 @@ function lme_heci() } module.exports = lme_heci; + diff --git a/modules/process-manager.js b/modules/process-manager.js index 9a14eac0..7613a2e9 100644 --- a/modules/process-manager.js +++ b/modules/process-manager.js @@ -166,7 +166,21 @@ function processManager() { p.waitExit(); } - var J = JSON.parse(p.stdout.str); + try + { + var J = JSON.parse(p.stdout.str); + } + catch (parseErr) + { + if (callback) + { + p.args = []; + for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } + p.args.unshift(null); + callback.apply(this, p.args); + } + break; + } if (callback) { p.args = []; @@ -209,7 +223,18 @@ function processManager() { if (callback) { - var J = JSON.parse(p.stdout.str); + try + { + var J = JSON.parse(p.stdout.str); + } + catch (parseErr) + { + p.args = []; + for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } + p.args.unshift(null); + callback.apply(this, p.args); + break; + } p.args = []; for (var i = 1; i < arguments.length; ++i) { p.args.push(arguments[i]); } if (process.platform == 'freebsd') diff --git a/modules/win-virtual-terminal.js b/modules/win-virtual-terminal.js index 818ab6a0..5d589e5a 100644 --- a/modules/win-virtual-terminal.js +++ b/modules/win-virtual-terminal.js @@ -185,9 +185,29 @@ function vt() } else { + k32.ClosePseudoConsole(ret._h.Deref()); + k32.CloseHandle(ret._input.Deref()); + k32.CloseHandle(ret._output.Deref()); + k32.CloseHandle(ret._consoleInput.Deref()); + k32.CloseHandle(ret._consoleOutput.Deref()); } } - + else + { + k32.ClosePseudoConsole(ret._h.Deref()); + k32.CloseHandle(ret._input.Deref()); + k32.CloseHandle(ret._output.Deref()); + k32.CloseHandle(ret._consoleInput.Deref()); + k32.CloseHandle(ret._consoleOutput.Deref()); + } + } + else + { + k32.ClosePseudoConsole(ret._h.Deref()); + k32.CloseHandle(ret._input.Deref()); + k32.CloseHandle(ret._output.Deref()); + k32.CloseHandle(ret._consoleInput.Deref()); + k32.CloseHandle(ret._consoleOutput.Deref()); } throw ('Internal Error'); } @@ -235,4 +255,4 @@ function vt() if (process.platform == 'win32') { module.exports = new vt(); -} \ No newline at end of file +} diff --git a/modules/win-wmi.js b/modules/win-wmi.js index 02bc675d..75d4f18a 100644 --- a/modules/win-wmi.js +++ b/modules/win-wmi.js @@ -254,6 +254,8 @@ function enumerateProperties(j, fields) { properties.push(nn.Deref().increment(i * GM.PointerSize).Deref().Wide2UTF8); } + + OleAut32.SafeArrayUnaccessData(nme.Deref()); } // Now we need to introspect the Array Fields @@ -456,3 +458,4 @@ function query(resourceString, queryString, fields) } module.exports = { query: query, queryAsync: queryAsync }; +