Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions kafka/sasl/gssapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import absolute_import

import struct

# needed for SASL_GSSAPI authentication:
try:
import gssapi
Expand Down Expand Up @@ -68,8 +70,8 @@ def receive(self, auth_bytes):
client_flags = self.SASL_QOP_AUTH
server_flags = msg[0]
message_parts = [
bytes(client_flags & server_flags),
msg[:1],
struct.Struct('>b').pack(client_flags & server_flags),
msg[1:],
self.auth_id.encode('utf-8'),
]
# add authorization identity to the response, and GSS-wrap
Expand Down
2 changes: 1 addition & 1 deletion test/sasl/test_gssapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def mocked_message_wrapper(msg, *args):
while not gssapi.is_done():
send_token = gssapi.auth_bytes()
receive_token = send_token # not realistic, but enough for testing
if send_token == b'\x00cbar@foo': # final wrapped message
if send_token == b'\x01ompletebar@foo': # final wrapped message
receive_token = b'' # final message gets an empty response
gssapi.receive(receive_token)
if client_ctx.step.call_count == 3:
Expand Down
Loading