diff options
author | Fraser Tweedale <ftweedal@redhat.com> | 2016-11-16 19:31:19 +1000 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2017-01-11 15:26:20 +0100 |
commit | db6674096c598918ea6b12ca33a96cf5e617a434 (patch) | |
tree | 78c2ebbab25aeb4309b6f63af4238639716784aa /ipaserver/install/installutils.py | |
parent | 324183cd63aeadbaa9678d610ba59e1295a606fe (diff) | |
download | freeipa-db6674096c598918ea6b12ca33a96cf5e617a434.tar.gz freeipa-db6674096c598918ea6b12ca33a96cf5e617a434.tar.xz freeipa-db6674096c598918ea6b12ca33a96cf5e617a434.zip |
installutils: remove hardcoded subject DN assumption
`installutils.load_external_cert` assumes that the IPA CA subject
DN is `CN=Certificate Authority, {subject_base}`. In preparation
for full customisability of IPA CA subject DN, push this assumption
out of this function to call sites (which will be updated in a
subsequent commit).
Part of: https://fedorahosted.org/freeipa/ticket/2614
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r-- | ipaserver/install/installutils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index e7fd69fcd..21cf4c107 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -1095,7 +1095,8 @@ def check_entropy(): except ValueError as e: root_logger.debug("Invalid value in %s %s", paths.ENTROPY_AVAIL, e) -def load_external_cert(files, subject_base): + +def load_external_cert(files, ca_subject): """ Load and verify external CA certificate chain from multiple files. @@ -1103,7 +1104,7 @@ def load_external_cert(files, subject_base): chain formats. :param files: Names of files to import - :param subject_base: Subject name base for IPA certificates + :param ca_subject: IPA CA subject DN :returns: Temporary file with the IPA CA certificate and temporary file with the external CA certificate chain """ @@ -1117,7 +1118,7 @@ def load_external_cert(files, subject_base): except RuntimeError as e: raise ScriptError(str(e)) - ca_subject = DN(('CN', 'Certificate Authority'), subject_base) + ca_subject = DN(ca_subject) ca_nickname = None cache = {} for nickname, _trust_flags in nssdb.list_certs(): |