Skip to content

Commit

Permalink
fix: activation to acm issue
Browse files Browse the repository at this point in the history
  • Loading branch information
graikhel-intel committed Jun 13, 2023
1 parent 53e2c5c commit 43c16d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions certoperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ module.exports.CertificateOperations = function (parent) {
var signkey = null, certChain = null, hashAlgo = null, certIndex = null;
for (var i in domain.amtacmactivation.certs) {
const certEntry = domain.amtacmactivation.certs[i];
if ((certEntry.sha256 == request.hash) && ((certEntry.cn == '*') || checkAcmActivationCertName(certEntry.cn, request.fqdn))) { hashAlgo = 'sha256'; signkey = certEntry.key; certChain = certEntry.certs; certIndex = i; break; }
if ((certEntry.sha1 == request.hash) && ((certEntry.cn == '*') || checkAcmActivationCertName(certEntry.cn, request.fqdn))) { hashAlgo = 'sha1'; signkey = certEntry.key; certChain = certEntry.certs; certIndex = i; break; }
if ((certEntry.sha256 == request.hash) && ((certEntry.cn == '*') || checkAcmActivationCertName(certEntry.cn, request.fqdn))) { hashAlgo = certEntry.hashAlgorithm; signkey = certEntry.key; certChain = certEntry.certs; certIndex = i; break; }
if ((certEntry.sha1 == request.hash) && ((certEntry.cn == '*') || checkAcmActivationCertName(certEntry.cn, request.fqdn))) { hashAlgo = certEntry.hashAlgorithm; signkey = certEntry.key; certChain = certEntry.certs; certIndex = i; break; }
}
if (signkey == null) return { 'action': 'acmactivate', 'error': 2, 'errorText': "Can't sign ACM request, no signing certificate found." }; // Did not find a match.

Expand Down Expand Up @@ -262,7 +262,8 @@ module.exports.CertificateOperations = function (parent) {
acmconfig.cn = certCommonName.value;
}
}

acmconfig.hashAlgorithm = r.certs[0].md.algorithm;

delete acmconfig.cert;
delete acmconfig.certpass;
acmconfig.certs = orderedCerts;
Expand Down

0 comments on commit 43c16d0

Please sign in to comment.