Fix IssuerDN presence check in cert search result

When checking for presence of IssuerDN in certificate search result,
we mistakenly check for the presence of the SubjectDN field, then
unsafely index into the IssuerDN field.  Check the presence of
IssuerDN correctly.

Part of: https://fedorahosted.org/freeipa/ticket/4559

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Fraser Tweedale
2016-06-27 16:26:24 +10:00
committed by Martin Basti
parent 9392b21271
commit 47d33f3650

View File

@@ -1903,7 +1903,7 @@ class ra(rabase.rabase):
response_request['subject'] = unicode(dn[0].text)
issuer_dn = cert.xpath('IssuerDN')
if len(dn) == 1:
if len(issuer_dn) == 1:
response_request['issuer'] = unicode(issuer_dn[0].text)
status = cert.xpath('Status')