mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	fix: activation to acm issue
This commit is contained in:
		
							parent
							
								
									53e2c5cf69
								
							
						
					
					
						commit
						43c16d02f9
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -85,8 +85,8 @@ module.exports.CertificateOperations = function (parent) {
 | 
				
			||||||
        var signkey = null, certChain = null, hashAlgo = null, certIndex = null;
 | 
					        var signkey = null, certChain = null, hashAlgo = null, certIndex = null;
 | 
				
			||||||
        for (var i in domain.amtacmactivation.certs) {
 | 
					        for (var i in domain.amtacmactivation.certs) {
 | 
				
			||||||
            const certEntry = domain.amtacmactivation.certs[i];
 | 
					            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.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 = 'sha1'; 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.
 | 
					        if (signkey == null) return { 'action': 'acmactivate', 'error': 2, 'errorText': "Can't sign ACM request, no signing certificate found." }; // Did not find a match.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -262,6 +262,7 @@ module.exports.CertificateOperations = function (parent) {
 | 
				
			||||||
                        acmconfig.cn = certCommonName.value;
 | 
					                        acmconfig.cn = certCommonName.value;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                acmconfig.hashAlgorithm = r.certs[0].md.algorithm;
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                delete acmconfig.cert;
 | 
					                delete acmconfig.cert;
 | 
				
			||||||
                delete acmconfig.certpass;
 | 
					                delete acmconfig.certpass;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue