From a17fd2f26872c83e6a1ec1a2ac350efdf67552d5 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Mon, 18 Dec 2023 12:11:52 +0000 Subject: [PATCH] revert hashAlgorithm to fix peform signature revert commit 43c16d02f9c5538c1dbc9459eaeff5a4a250d8bd --- certoperations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certoperations.js b/certoperations.js index dd3e2c3c..40447ab0 100644 --- a/certoperations.js +++ b/certoperations.js @@ -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 = 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 ((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 (signkey == null) return { 'action': 'acmactivate', 'error': 2, 'errorText': "Can't sign ACM request, no signing certificate found." }; // Did not find a match.