From 6bb240fa2cf6ce257376241d0a779ca5cc96078e Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 4 Aug 2014 11:13:25 +0200 Subject: Fix parsing of long nicknames in certutil -L output. https://fedorahosted.org/freeipa/ticket/4453 Reviewed-By: Petr Viktorin --- ipaserver/install/certs.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ipaserver') diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py index f958e366e..6569f5144 100644 --- a/ipaserver/install/certs.py +++ b/ipaserver/install/certs.py @@ -137,10 +137,9 @@ class NSSDatabase(object): # FIXME, this relies on NSS never changing the formatting of certutil certlist = [] for cert in certs: - nickname = cert[0:61] - trust = cert[61:] - if re.match(r'\w*,\w*,\w*', trust): - certlist.append((nickname.strip(), trust.strip())) + match = re.match(r'^(.+?)\s+(\w*,\w*,\w*)\s*$', cert) + if match: + certlist.append(match.groups()) return tuple(certlist) -- cgit