mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
py3: fix csrgen error handling
csrgen error handling marshalls an error string from libcrypto. This is not handled correctly under python3. Fix the error handling. Part of: https://pagure.io/freeipa/issue/7496 Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
13b9608d5c
commit
53f87ee5cd
@ -182,8 +182,12 @@ def _raise_openssl_errors():
|
||||
|
||||
code = ERR_get_error()
|
||||
while code != 0:
|
||||
msg = ERR_error_string(code, NULL)
|
||||
msgs.append(_ffi.string(msg))
|
||||
msg = _ffi.string(ERR_error_string(code, NULL))
|
||||
try:
|
||||
strmsg = msg.decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
strmsg = repr(msg)
|
||||
msgs.append(strmsg)
|
||||
code = ERR_get_error()
|
||||
|
||||
raise errors.CSRTemplateError(reason='\n'.join(msgs))
|
||||
|
Loading…
Reference in New Issue
Block a user