Skip to content
Snippets Groups Projects
Commit 34dc7580 authored by Alexander Bokovoy's avatar Alexander Bokovoy
Browse files

Fix CA certificates iteration

FreeIPA fix for https://pagure.io/freeipa/issue/9652

 now produces five
elements tuple when iterating over CA certificate list, the last element
being the serial number. We do not need it, so extract only the first
four elements (certificate, nickname, trusted, EKU).

The regression was introduced by FreeIPA commit
f91b677ada376034b25d50e78475237c5976770e.

Signed-off-by: default avatarAlexander Bokovoy <abokovoy@redhat.com>
parent feb33e4e
No related branches found
No related tags found
No related merge requests found
...@@ -340,17 +340,19 @@ def main(): ...@@ -340,17 +340,19 @@ def main():
ca_subject) ca_subject)
ca_certs_trust = [(c, n, ca_certs_trust = [(c, n,
certstore.key_policy_to_trust_flags(t, True, u)) certstore.key_policy_to_trust_flags(t, True, u))
for (c, n, t, u) in ca_certs] for (c, n, t, u) in [x[0:4] for x in ca_certs]]
if hasattr(paths, "KDC_CA_BUNDLE_PEM"): if hasattr(paths, "KDC_CA_BUNDLE_PEM"):
x509.write_certificate_list( x509.write_certificate_list(
[c for c, n, t, u in ca_certs if t is not False], [c for c, n, t, u in [x[0:4] for x in ca_certs]
if t is not False],
paths.KDC_CA_BUNDLE_PEM, paths.KDC_CA_BUNDLE_PEM,
# mode=0o644 # mode=0o644
) )
if hasattr(paths, "CA_BUNDLE_PEM"): if hasattr(paths, "CA_BUNDLE_PEM"):
x509.write_certificate_list( x509.write_certificate_list(
[c for c, n, t, u in ca_certs if t is not False], [c for c, n, t, u in [x[0:4] for x in ca_certs]
if t is not False],
paths.CA_BUNDLE_PEM, paths.CA_BUNDLE_PEM,
# mode=0o644 # mode=0o644
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment