Updated MeshCentral Router.
Ylian Saint-Hilaire committed
Mar 3, 2021 at 11:03 UTC
6ab0bae5872978b9f6c4aed27589fc4af043e402
2 files changed
+28
agents/MeshCentralRouter.exe
Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ
agents/modules_meshcore/amt-mei.js
+28
@@ -419,6 +419,34 @@ function amt_heci() {
419
420
}, this, callback, optional);
421
}
422
+ this.startConfigurationHBased = function startConfigurationHBased(certHash, hostVpn, dnsSuffixList, callback) {
423
+ var optional = [];
424
+ for (var i = 4; i < arguments.length; ++i) { optional.push(arguments[i]); }
425
+
426
+ var data = Buffer.alloc(4 + 64 + 4 + 4 + 320);
427
+ data.writeUInt32LE((certHash.length == 48) ? 3 : 2, 0); // Write certificate hash: SHA256 = 2, SHA384 = 3
428
+ data.write(certHash, 4); // Write the hash
429
+ data.writeUInt32LE(hostVpn ? 1 : 0, 68);
430
+ data.writeUInt32LE(0, 72); // dnsSuffixList.length
431
+ // TODO: Write up to 4 DNS Suffix with null seperation.
432
+
433
+ console.log('Sending', data.toString('hex'));
434
+
435
+ this.sendCommand(139, data, function (header, fn, opt) {
436
+ console.log('Status', header.Status);
437
+ console.log('DataLength', header.Data.length);
438
+ console.log('Data', header.Data.toString('hex'));
439
+ /*
440
+ if (header.Status == 0 && header.Data.length == 68) {
441
+ opt.unshift({ user: trim(header.Data.slice(0, 33).toString()), pass: trim(header.Data.slice(33, 67).toString()), raw: header.Data });
442
+ }
443
+ else {
444
+ opt.unshift(null);
445
+ }
446
+ */
447
+ fn.apply(this, opt);
448
+ }, callback, optional);
449
+ }
450
}
451
452
module.exports = amt_heci;
\ No newline at end of file