CA-less install: non-ASCII chars in CA cert subject

In a CA-less install, if the CA cert subject contains
non-ascii characters, ipa-server-install fails when
configuring SSL for httpd.

The issue happens when calling ipautil.run to extract the keys
from a p12file. The code is using the raw output of the command
and doesn't need to specify capture_output=True, as this option
breaks if the output contains non-ascii characters.
The raw_output contains bytes, the output is a str built by decoding
the raw_output and may fail if non-ascii characters are present.

Fixes: https://pagure.io/freeipa/issue/8880
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Florence Blanc-Renaud committed 2021-06-17 08:11:43 +02:00
1 parent 22f0d8c50a
commit 7b278b63b4
1 file changed
+1 -1
+1 -1
View File
@@ -103,7 +103,7 @@ def pkcs12_to_certkeys(p12_fname, p12_passwd=None):
else:
args.extend(["-passin", "pass:"])
pems = ipautil.run(args, capture_output=True).raw_output
pems = ipautil.run(args).raw_output
certs = x509.load_certificate_list(pems)
priv_keys = x509.load_private_key_list(pems)