summaryrefslogtreecommitdiffstats
path: root/ipalib/pkcs10.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/pkcs10.py')
-rw-r--r--ipalib/pkcs10.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipalib/pkcs10.py b/ipalib/pkcs10.py
index f3f82c40d..9119d12e2 100644
--- a/ipalib/pkcs10.py
+++ b/ipalib/pkcs10.py
@@ -372,12 +372,14 @@ def strip_header(csr):
"""
Remove the header and footer from a CSR.
"""
+ headerlen = 40
s = csr.find("-----BEGIN NEW CERTIFICATE REQUEST-----")
if s == -1:
+ headerlen = 36
s = csr.find("-----BEGIN CERTIFICATE REQUEST-----")
if s >= 0:
e = csr.find("-----END")
- csr = csr[s+40:e]
+ csr = csr[s+headerlen:e]
return csr