summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-05-03 17:38:39 -0400
committerJason Gerard DeRose <jderose@redhat.com>2010-05-03 17:58:08 -0600
commit3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23 (patch)
treef10938893f3b22361e46fd7ad16c8ea9df4e91ae /ipapython
parent3698dca8e350febf21f830d61630e12d40d51392 (diff)
downloadfreeipa-3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23.tar.gz
freeipa-3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23.tar.xz
freeipa-3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23.zip
Handle CSRs whether they have NEW in the header or not
Also consolidate some duplicate code
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/certdb.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/ipapython/certdb.py b/ipapython/certdb.py
index 891b6c061..fb99e25ac 100644
--- a/ipapython/certdb.py
+++ b/ipapython/certdb.py
@@ -19,6 +19,7 @@
from ipapython import ipautil
from ipapython import nsslib
+from ipalib import pkcs10
import tempfile
import sha
import shutil
@@ -99,13 +100,7 @@ class CertDB(object):
f.close()
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)
return csr