diff options
author | Lynn Root <lroot@redhat.com> | 2012-12-10 09:13:13 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-12-11 12:29:09 +0100 |
commit | 7340752fc32c7405100ddee7ecf23c72c1d9c086 (patch) | |
tree | 84ecb0d42d9be08205e2ce1416004e85958413ed /ipalib | |
parent | 39ec75bef9077c0e520708ae22b9a9196b68105e (diff) | |
download | freeipa.git-7340752fc32c7405100ddee7ecf23c72c1d9c086.tar.gz freeipa.git-7340752fc32c7405100ddee7ecf23c72c1d9c086.tar.xz freeipa.git-7340752fc32c7405100ddee7ecf23c72c1d9c086.zip |
Raise ValidationError when CSR does not have a subject hostname
Raise ValidationError when CSR does not have a subject hostname.
Ticket: https://fedorahosted.org/freeipa/ticket/3123
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/cert.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index c4bbf821..3aa01621 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -296,6 +296,10 @@ class cert_request(VirtualCommand): # Ensure that the hostname in the CSR matches the principal subject_host = get_csr_hostname(csr) + if not subject_host: + raise errors.ValidationError(name='csr', + error=_("No hostname was found in subject of request.")) + (servicename, hostname, realm) = split_principal(principal) if subject_host.lower() != hostname.lower(): raise errors.ACIError( |