diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-05-03 17:38:39 -0400 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2010-05-03 17:58:08 -0600 |
commit | 3ea044fb59bf6ada2c0e9b507c1d6c4dfd8aaa23 (patch) | |
tree | f10938893f3b22361e46fd7ad16c8ea9df4e91ae /ipalib | |
parent | 3698dca8e350febf21f830d61630e12d40d51392 (diff) | |
download | freeipa-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 'ipalib')
-rw-r--r-- | ipalib/pkcs10.py | 4 |
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 |