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

Added support for custom agent code signing cert and code signing fixes.

This commit is contained in:
Ylian Saint-Hilaire 2022-05-28 22:59:21 -07:00
parent 205441bdd4
commit 3e44d64c19
2 changed files with 10 additions and 7 deletions

View file

@ -2847,9 +2847,11 @@ function CreateMeshCentralServer(config, args) {
var objx = domain, suffix = '';
if (domain.id == '') { objx = obj; } else { suffix = '-' + domain.id; objx.meshAgentBinaries = {}; }
// Get agent code signature certificate ready with the full cert chain
var agentSignCertInfo = null;
if (obj.certificates.codesign) {
// Check if a custom agent signing certificate is available
var agentSignCertInfo = require('./authenticode.js').loadCertificates([ obj.path.join(obj.datapath, 'agentsigningcert.pem') ]);
// If not using a custom signing cert, get agent code signature certificate ready with the full cert chain
if ((agentSignCertInfo == null) && (obj.certificates.codesign != null)) {
agentSignCertInfo = {
cert: obj.certificateOperations.forge.pki.certificateFromPem(obj.certificates.codesign.cert),
key: obj.certificateOperations.forge.pki.privateKeyFromPem(obj.certificates.codesign.key),