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:
parent
205441bdd4
commit
3e44d64c19
2 changed files with 10 additions and 7 deletions
|
@ -51,8 +51,8 @@ function createOutFile(args, filename) {
|
|||
}
|
||||
|
||||
// Load certificates and private key from PEM files
|
||||
function loadCertificates(args) {
|
||||
var certs = [], keys = [], pemFileNames = args.pem;
|
||||
function loadCertificates(pemFileNames) {
|
||||
var certs = [], keys = [];
|
||||
if (pemFileNames == null) return;
|
||||
if (typeof pemFileNames == 'string') { pemFileNames = [pemFileNames]; }
|
||||
for (var i in pemFileNames) {
|
||||
|
@ -421,7 +421,7 @@ function start() {
|
|||
if (command == 'sign') { // Sign an executable
|
||||
if (typeof args.exe != 'string') { console.log("Missing --exe [filename]"); return; }
|
||||
createOutFile(args, args.exe);
|
||||
const cert = loadCertificates(args);
|
||||
const cert = loadCertificates(args.pem);
|
||||
if (cert == null) { console.log("Unable to load certificate and/or private key, generating test certificate."); }
|
||||
console.log("Signing to " + args.out); exe.sign(cert, args); console.log("Done.");
|
||||
}
|
||||
|
@ -449,4 +449,5 @@ function start() {
|
|||
if (require.main === module) { start(); }
|
||||
|
||||
// Exports
|
||||
module.exports.createAuthenticodeHandler = createAuthenticodeHandler;
|
||||
module.exports.createAuthenticodeHandler = createAuthenticodeHandler;
|
||||
module.exports.loadCertificates = loadCertificates;
|
Loading…
Add table
Add a link
Reference in a new issue