summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/cert.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-10-16 07:39:51 +0000
committerPetr Viktorin <pviktori@redhat.com>2014-03-25 16:54:55 +0100
commitd5e35f92a55d4e80d13ce157a8aa8f36276ad327 (patch)
treee714679ab1a77a92c2157f129076d41566387da8 /ipalib/plugins/cert.py
parentbab88eb1ed440d1e62eb59e32c4d22fa178f4869 (diff)
downloadfreeipa-d5e35f92a55d4e80d13ce157a8aa8f36276ad327.tar.gz
freeipa-d5e35f92a55d4e80d13ce157a8aa8f36276ad327.tar.xz
freeipa-d5e35f92a55d4e80d13ce157a8aa8f36276ad327.zip
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 <pviktori@redhat.com>
Diffstat (limited to 'ipalib/plugins/cert.py')
-rw-r--r--ipalib/plugins/cert.py8
1 files changed, 3 insertions, 5 deletions
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)