From 449e4357e733a70e8f27f65f69ca8f0f7c8b5b21 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Sat, 12 Dec 2015 04:10:54 +0100 Subject: 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 --- base/common/python/pki/nss.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'base/common/python') 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': -- cgit