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:28:59 +0100 |
commit | 4d6de44d3deb321aaf0fa3038f2770aaaa449783 (patch) | |
tree | 7803802a5229159388a47887835c2b42ce3faedf /ipalib | |
parent | c481e40d78023731ec9def5fd367bed8c75cd416 (diff) | |
download | freeipa-4d6de44d3deb321aaf0fa3038f2770aaaa449783.tar.gz freeipa-4d6de44d3deb321aaf0fa3038f2770aaaa449783.tar.xz freeipa-4d6de44d3deb321aaf0fa3038f2770aaaa449783.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 c4bbf8215..3aa01621d 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( |