diff options
author | Endi S. Dewata <edewata@redhat.com> | 2015-12-12 04:10:54 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-01-08 19:55:50 +0100 |
commit | 449e4357e733a70e8f27f65f69ca8f0f7c8b5b21 (patch) | |
tree | 29e9635ba3e322f4d466c7de854a37d704597f85 /base/common/python | |
parent | 9d64c0b8e58fa4bb1b5504167b7d80b90e0ae1ff (diff) | |
download | pki-449e4357e733a70e8f27f65f69ca8f0f7c8b5b21.tar.gz pki-449e4357e733a70e8f27f65f69ca8f0f7c8b5b21.tar.xz pki-449e4357e733a70e8f27f65f69ca8f0f7c8b5b21.zip |
Fixed external CA case for IPA compatibility.
The installation code for external CA case has been fixed such
that IPA can detect step 1 completion properly.
The code that handles certificate data conversion has been fixed
to reformat base-64 data for PEM output properly.
The installation summary for step 1 has been updated to provide
more accurate information.
https://fedorahosted.org/pki/ticket/456
Diffstat (limited to 'base/common/python')
-rw-r--r-- | base/common/python/pki/nss.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/base/common/python/pki/nss.py b/base/common/python/pki/nss.py index 196fe462f..67fd90b4c 100644 --- a/base/common/python/pki/nss.py +++ b/base/common/python/pki/nss.py @@ -43,9 +43,13 @@ def convert_data(data, input_format, output_format, header=None, footer=None): if input_format == 'base64' and output_format == 'pem': - # split a single line into multiple lines - data = data.rstrip('\r\n') + # join base-64 data into a single line + data = data.replace('\r', '').replace('\n', '') + + # re-split the line into fixed-length lines lines = [data[i:i+64] for i in range(0, len(data), 64)] + + # add header and footer return '%s\n%s\n%s\n' % (header, '\n'.join(lines), footer) if input_format == 'pem' and output_format == 'base64': |