summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/cainstance.py5
-rw-r--r--ipaserver/install/certs.py15
2 files changed, 5 insertions, 15 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 9e55333db..375676ae7 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -36,6 +36,7 @@ import urllib
import xml.dom.minidom
import stat
from ipapython import dogtag
+from ipalib import pkcs10
import subprocess
from nss.error import NSPRError
@@ -911,9 +912,7 @@ class CAInstance(service.Service):
finally:
os.remove(noise_name)
- csr = stdout.find("-----BEGIN NEW CERTIFICATE REQUEST-----")
- if csr >= 0:
- csr = stdout[csr:]
+ csr = pkcs10.strip_header(stdout)
# Send the request to the CA
conn = httplib.HTTPConnection(self.host_name, 9180)
diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index 05c9213bb..6fb012919 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -32,6 +32,7 @@ from ipapython import nsslib
from ipapython import dogtag
from ipapython import sysrestore
from ipapython import ipautil
+from ipalib import pkcs10
from ConfigParser import RawConfigParser
from nss.error import NSPRError
@@ -552,12 +553,7 @@ class CertDB(object):
csr = "".join(csr)
# We just want the CSR bits, make sure there is nothing else
- s = csr.find("-----BEGIN NEW CERTIFICATE REQUEST-----")
- e = csr.find("-----END NEW CERTIFICATE REQUEST-----")
- if e > 0:
- e = e + 37
- if s >= 0:
- csr = csr[s:]
+ csr = pkcs10.strip_header(csr)
params = {'profileId': 'caRAserverCert',
'cert_request_type': 'pkcs10',
@@ -639,12 +635,7 @@ class CertDB(object):
csr = "".join(csr)
# We just want the CSR bits, make sure there is no thing else
- s = csr.find("-----BEGIN NEW CERTIFICATE REQUEST-----")
- e = csr.find("-----END NEW CERTIFICATE REQUEST-----")
- if e > 0:
- e = e + 37
- if s >= 0:
- csr = csr[s:]
+ csr = pkcs10.strip_header(csr)
params = {'profileId': 'caJarSigningCert',
'cert_request_type': 'pkcs10',