mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
certdb: add named trust flag constants
Add named constants for common trust flag combinations. Use the named constants instead of trust flags strings in the code. https://pagure.io/freeipa/issue/6831 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com> Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
a0566ed9ce
commit
235265a5f5
@@ -32,6 +32,7 @@ import fnmatch
|
||||
import ldap
|
||||
|
||||
from ipalib.install import certmonger, certstore
|
||||
from ipapython.certdb import IPA_CA_TRUST_FLAGS, EXTERNAL_CA_TRUST_FLAGS
|
||||
from ipapython.ipa_log_manager import root_logger
|
||||
from ipapython import ipautil, ipaldap
|
||||
from ipapython import dogtag
|
||||
@@ -766,7 +767,7 @@ class DsInstance(service.Service):
|
||||
)
|
||||
if self.pkcs12_info:
|
||||
if self.ca_is_configured:
|
||||
trust_flags = 'CT,C,C'
|
||||
trust_flags = IPA_CA_TRUST_FLAGS
|
||||
else:
|
||||
trust_flags = None
|
||||
dsdb.create_from_pkcs12(self.pkcs12_info[0], self.pkcs12_info[1],
|
||||
@@ -1065,7 +1066,7 @@ class DsInstance(service.Service):
|
||||
certdb.cacert_name = cacert_name
|
||||
status = True
|
||||
try:
|
||||
certdb.load_cacert(cacert_fname, 'C,,')
|
||||
certdb.load_cacert(cacert_fname, EXTERNAL_CA_TRUST_FLAGS)
|
||||
except ipautil.CalledProcessError as e:
|
||||
root_logger.critical("Error importing CA cert file named [%s]: %s" %
|
||||
(cacert_fname, str(e)))
|
||||
|
||||
Reference in New Issue
Block a user