From d5e35f92a55d4e80d13ce157a8aa8f36276ad327 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 16 Oct 2013 07:39:51 +0000 Subject: Update pkcs10 module functions to always load CSRs and allow selecting format. This change makes the pkcs10 module more consistent with the x509 module. Reviewed-By: Petr Viktorin --- ipalib/plugins/cert.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ipalib/plugins/cert.py') diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index 5fa9206d5..90d450504 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -138,9 +138,8 @@ def get_csr_hostname(csr): Return the value of CN in the subject of the request or None """ try: - request = pkcs10.load_certificate_request(csr) - subject = pkcs10.get_subject(request) - return subject.common_name + subject = pkcs10.get_subject(csr) + return subject.common_name #pylint: disable=E1101 except NSPRError, nsprerr: raise errors.CertificateOperationError( error=_('Failure decoding Certificate Signing Request: %s') % nsprerr) @@ -368,8 +367,7 @@ class cert_request(VirtualCommand): "to the 'userCertificate' attribute of entry '%s'.") % dn) # Validate the subject alt name, if any - request = pkcs10.load_certificate_request(csr) - subjectaltname = pkcs10.get_subjectaltname(request) + subjectaltname = pkcs10.get_subjectaltname(csr) if subjectaltname is not None: for name in subjectaltname: name = unicode(name) -- cgit