diff options
| author | Martin Basti <mbasti@redhat.com> | 2017-01-24 17:49:06 +0100 |
|---|---|---|
| committer | Jan Cholasta <jcholast@redhat.com> | 2017-02-08 08:32:44 +0100 |
| commit | caa560ca79e4038b161b27d11e3f144606dbbcdb (patch) | |
| tree | d3b4b053061170ffa182be3f1e012e56899eac78 /ipaserver/plugins/cert.py | |
| parent | 8e139d4b559a6f19d859e078e1940a69d8977fdb (diff) | |
| download | freeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.tar.gz freeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.tar.xz freeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.zip | |
py3: base64 encoding/decoding returns always bytes don't mix it
Using unicode(bytes) call causes undesired side effect that is inserting
`b` character to result. This obviously causes issues with binary base64 data
https://fedorahosted.org/freeipa/ticket/4985
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins/cert.py')
| -rw-r--r-- | ipaserver/plugins/cert.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py index 5bf4cfba3..6bf5c03ef 100644 --- a/ipaserver/plugins/cert.py +++ b/ipaserver/plugins/cert.py @@ -1260,7 +1260,7 @@ class cert_find(Search, CertMethod): return (DN(cert_obj.issuer), cert_obj.serial) def _get_cert_obj(self, cert, all, raw, pkey_only): - obj = {'certificate': unicode(base64.b64encode(cert))} + obj = {'certificate': base64.b64encode(cert).decode('ascii')} full = not pkey_only and all if not raw: |
