Skip to content

Commit 539c33e

Browse files
committed
Fixup sasl message handling for py2
1 parent 223c320 commit 539c33e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka/sasl/gssapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ def receive(self, auth_bytes):
6868
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
6969
# by the server
7070
client_flags = self.SASL_QOP_AUTH
71-
server_flags = msg[0]
71+
server_flags = struct.Struct('>b').unpack(msg[0:1])[0]
7272
message_parts = [
7373
struct.Struct('>b').pack(client_flags & server_flags),
74-
msg[1:],
74+
msg[1:], # always agree to max message size from server
7575
self.auth_id.encode('utf-8'),
7676
]
7777
# add authorization identity to the response, and GSS-wrap

0 commit comments

Comments
 (0)