Fix parsing of long nicknames in certutil -L output.

https://fedorahosted.org/freeipa/ticket/4453

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
Jan Cholasta 2014-08-04 11:13:25 +02:00 committed by Petr Viktorin
parent 6bb4eea348
commit 6bb240fa2c

View File

@ -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)