Skip to content

Commit

Permalink
Fix for Python 3 byte string handling in SASL auth (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophelec authored and dpkp committed Jan 24, 2018
1 parent bfa6e20 commit 351f418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
* Lou Marvin Caraig, [@se7entyse7en](https://github.com/se7entyse7en)
* waliaashish85, [@waliaashish85](https://github.com/waliaashish85)
* Mark Roberts, [@wizzat](https://github.com/wizzat)
* Christophe Lecointe [@christophelec](https://github.com/christophelec)
* Mohamed Helmi Hichri [@hellich](https://github.com/hellich)

Thanks to all who have contributed!
4 changes: 2 additions & 2 deletions kafka/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ def _try_authenticate_gssapi(self, future):
# Kafka currently doesn't support integrity or confidentiality security layers, so we
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
# by the server
msg = Int8.encode(SASL_QOP_AUTH & Int8.decode(io.BytesIO(msg[0]))) + msg[1:]
msg = Int8.encode(SASL_QOP_AUTH & Int8.decode(io.BytesIO(msg[0:1]))) + msg[1:]
# add authorization identity to the response, GSS-wrap and send it
msg = client_ctx.wrap(msg + auth_id, False).message
msg = client_ctx.wrap(msg + auth_id.encode(), False).message
size = Int32.encode(len(msg))
self._send_bytes_blocking(size + msg)

Expand Down

0 comments on commit 351f418

Please sign in to comment.