From 4d6de44d3deb321aaf0fa3038f2770aaaa449783 Mon Sep 17 00:00:00 2001 From: Lynn Root Date: Mon, 10 Dec 2012 09:13:13 -0500 Subject: 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 --- ipalib/plugins/cert.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ipalib/plugins/cert.py') 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( -- cgit