mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Handle CSRs whether they have NEW in the header or not
Also consolidate some duplicate code
This commit is contained in:
committed by
Jason Gerard DeRose
parent
3698dca8e3
commit
3ea044fb59
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user