File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import
2
2
3
- import struct
4
-
5
3
# needed for SASL_GSSAPI authentication:
6
4
try :
7
5
import gssapi
@@ -67,8 +65,10 @@ def receive(self, auth_bytes):
67
65
# Kafka currently doesn't support integrity or confidentiality security layers, so we
68
66
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
69
67
# by the server
68
+ client_flags = self .SASL_QOP_AUTH
69
+ server_flags = msg [0 ]
70
70
message_parts = [
71
- struct . pack ( '>b' , self . SASL_QOP_AUTH & struct . unpack ( '>b' , msg [ 0 : 1 ]) ),
71
+ bytes ( client_flags & server_flags ),
72
72
msg [:1 ],
73
73
self .auth_id .encode ('utf-8' ),
74
74
]
Original file line number Diff line number Diff line change @@ -91,8 +91,10 @@ def receive(self, auth_bytes):
91
91
# Kafka currently doesn't support integrity or confidentiality security layers, so we
92
92
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
93
93
# by the server
94
+ client_flags = self .SASL_QOP_AUTH
95
+ server_flags = msg [0 ]
94
96
message_parts = [
95
- Int8 . encode ( self . SASL_QOP_AUTH & Int8 . decode ( io . BytesIO ( msg [ 0 : 1 ])) ),
97
+ bytes ( client_flags & server_flags ),
96
98
msg [:1 ],
97
99
self .auth_id .encode ('utf-8' ),
98
100
]
You can’t perform that action at this time.
0 commit comments