Fix bytes-return of tls.cert_info extensions

This commit is contained in:
Ronald van Zantvoort 2018-08-15 01:06:00 +02:00
parent 9c7d3eae72
commit d435dbc85e
No known key found for this signature in database
GPG Key ID: D3DE53B7EFF75061

View File

@ -1641,7 +1641,8 @@ def cert_info(cert, digest='sha256'):
for i in _range(cert.get_extension_count()):
try:
ext = cert.get_extension(i)
ret['extensions'][ext.get_short_name()] = str(ext)
key = salt.utils.stringutils.to_unicode(ext.get_short_name())
ret['extensions'][key] = str(ext)
except AttributeError:
continue
@ -1655,7 +1656,7 @@ def cert_info(cert, digest='sha256'):
'with {2}'.format(ret['subject'], name, '/'.join(valid_entries)))
else:
valid_names.add(name)
ret['subject_alt_names'] = ' '.join(valid_names)
ret['subject_alt_names'] = valid_names
if hasattr(cert, 'get_signature_algorithm'):
try: