1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved AMT USB ACM activation.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-27 02:15:52 -07:00
parent ac8b423cdb
commit 27bd46a764
5 changed files with 785 additions and 781 deletions

View file

@ -198,7 +198,7 @@ module.exports.CertificateOperations = function (parent) {
// Get the setup.bin file
obj.GetSetupBinFile = function (amtacmactivation, oldmebxpass, newmebxpass) {
obj.GetSetupBinFile = function (amtacmactivation, oldmebxpass, newmebxpass, domain, user) {
// Create a setup.bin file for our own root cert
// Get the wiadcard certificate hash
var wildcardCertSha256 = null;
@ -248,14 +248,14 @@ module.exports.CertificateOperations = function (parent) {
v.moduleid = 2;
v.varid = 3;
v.length = -1;
v.value = 'meshcentral.com';
v.value = 'rootcert.meshcentral.com';
setupbin.records[0].variables.push(v);
return AmtSetupBinStack.AmtSetupBinEncode(setupbin);
// Write to log file
obj.logAmtActivation(domain, { time: new Date(), action: 'setupbin', domain: domain.id, userid: user._id, oldmebx: oldmebxpass, newmebx: newmebxpass, rootname: certRootName, hash: wildcardCertSha256, dns: 'rootcert.meshcentral.com' });
// Write the setup.bin file
//var bin = AmtSetupBinStack.AmtSetupBinEncode(setupbin);
//obj.fs.writeFileSync('c:\\temp\\setup.bin', bin, 'binary');
// Encode the setup.bin file
return AmtSetupBinStack.AmtSetupBinEncode(setupbin);
}
// Return the certificate of the remote HTTPS server