summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/cert.py
diff options
context:
space:
mode:
authorLynn Root <lroot@redhat.com>2012-12-10 09:13:13 -0500
committerMartin Kosek <mkosek@redhat.com>2012-12-11 12:28:59 +0100
commit4d6de44d3deb321aaf0fa3038f2770aaaa449783 (patch)
tree7803802a5229159388a47887835c2b42ce3faedf /ipalib/plugins/cert.py
parentc481e40d78023731ec9def5fd367bed8c75cd416 (diff)
downloadfreeipa-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/plugins/cert.py')
-rw-r--r--ipalib/plugins/cert.py4
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(