diff --git a/internal/policies/certificate/python/vendor_samba/gp/gp_cert_auto_enroll_ext.py b/internal/policies/certificate/python/vendor_samba/gp/gp_cert_auto_enroll_ext.py index 98b597e0f..1c1fc4bac 100644 --- a/internal/policies/certificate/python/vendor_samba/gp/gp_cert_auto_enroll_ext.py +++ b/internal/policies/certificate/python/vendor_samba/gp/gp_cert_auto_enroll_ext.py @@ -16,7 +16,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import configparser import os import operator import requests @@ -27,7 +26,7 @@ from vendor_samba.gp.gpclass import get_dc_hostname import base64 from shutil import which -from subprocess import Popen, PIPE, TimeoutExpired +from subprocess import Popen, PIPE import re import json from vendor_samba.gp.util.logging import log @@ -55,8 +54,6 @@ def load_der_pkcs7_certificates(x): return [] '/etc/pki/ca-trust/source/anchors', # RHEL/Fedora '/usr/local/share/ca-certificates'] # Debian/Ubuntu -CEPCES_CONFIG_PATH = '/etc/cepces/cepces.conf' - def octet_string_to_objectGUID(data): """Convert an octet string to an objectGUID.""" return '%s-%s-%s-%s-%s' % ('%02x' % struct.unpack(' 0: - cep_data = self.__read_cep_data(guid, ldb, end_point_information, trust_dir, private_dir) - if cep_data: - ca_names.extend(cep_data) + ca_names.extend(self.__read_cep_data(guid, ldb, + end_point_information, + trust_dir, private_dir)) else: cas = fetch_certification_authorities(ldb) for ca in cas: - try: - self.apply(guid, ca, cert_enroll, ca, ldb, trust_dir, private_dir) - except Exception as e: - log.warn(f"Could not enroll to CA {ca['name']}: {e}") - continue + self.apply(guid, ca, cert_enroll, ca, ldb, trust_dir, + private_dir) ca_names.append(ca['name']) - log.debug(f'Enrolled to the following CAs: {ca_names}') return ca_names def rsop(self, gpo):