summaryrefslogtreecommitdiffstats
path: root/base/common/python
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-06-14 05:55:01 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-06-14 17:16:15 +0200
commitdcb90d1dec94c97e9c78f25e863a30f8b2ceb0a8 (patch)
tree6fc512d069a5c1916e3e5319aeff6ca13f562751 /base/common/python
parent2ff3c4d50a3ca3f66db097d2c15f46417ad5a3fc (diff)
downloadpki-dcb90d1dec94c97e9c78f25e863a30f8b2ceb0a8.tar.gz
pki-dcb90d1dec94c97e9c78f25e863a30f8b2ceb0a8.tar.xz
pki-dcb90d1dec94c97e9c78f25e863a30f8b2ceb0a8.zip
Fixed problem with headerless PKCS #7 data.
Due to a recently added validation code, the headerless PKCS #7 data generated by IPA needs to be joined into a single line before storing it in CS.cfg.
Diffstat (limited to 'base/common/python')
-rw-r--r--base/common/python/pki/nssdb.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/common/python/pki/nssdb.py b/base/common/python/pki/nssdb.py
index 2504a9579..0c27c3f19 100644
--- a/base/common/python/pki/nssdb.py
+++ b/base/common/python/pki/nssdb.py
@@ -477,6 +477,13 @@ class NSSDatabase(object):
else: # import PKCS #7 data without header/footer
with open(cert_chain_file, 'r') as f:
base64_data = f.read()
+
+ # TODO: fix ipaserver/install/cainstance.py in IPA
+ # to no longer remove PKCS #7 header/footer
+
+ # join base-64 data into a single line
+ base64_data = base64_data.replace('\r', '').replace('\n', '')
+
pkcs7_data = convert_pkcs7(base64_data, 'base64', 'pem')
tmp_cert_chain_file = os.path.join(tmpdir, 'cert_chain.p7b')