1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

python/samba/tests: ensure byte content (not strings)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Noel Power 2018-04-30 18:31:36 +01:00 committed by Andrew Bartlett
parent b3a5dac3e3
commit c958a04327

View File

@ -139,7 +139,7 @@ class RawDCERPCTest(TestCase):
ctx_list = [ctx] ctx_list = [ctx]
if auth_context is not None: if auth_context is not None:
from_server = "" from_server = b""
(finished, to_server) = auth_context["gensec"].update(from_server) (finished, to_server) = auth_context["gensec"].update(from_server)
self.assertFalse(finished) self.assertFalse(finished)
@ -148,7 +148,7 @@ class RawDCERPCTest(TestCase):
auth_context_id=auth_context["auth_context_id"], auth_context_id=auth_context["auth_context_id"],
auth_blob=to_server) auth_blob=to_server)
else: else:
auth_info = "" auth_info = b""
req = self.generate_bind(call_id=call_id, req = self.generate_bind(call_id=call_id,
pfc_flags=pfc_flags, pfc_flags=pfc_flags,
@ -333,14 +333,14 @@ class RawDCERPCTest(TestCase):
else: else:
sig_size = 16 sig_size = 16
zero_sig = "\x00" * sig_size zero_sig = b"\x00" * sig_size
auth_info = self.generate_auth(auth_type=auth_context["auth_type"], auth_info = self.generate_auth(auth_type=auth_context["auth_type"],
auth_level=auth_context["auth_level"], auth_level=auth_context["auth_level"],
auth_pad_length=auth_pad_length, auth_pad_length=auth_pad_length,
auth_context_id=auth_context["auth_context_id"], auth_context_id=auth_context["auth_context_id"],
auth_blob=zero_sig) auth_blob=zero_sig)
else: else:
auth_info = "" auth_info = b""
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST
pfc_flags |= samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST pfc_flags |= samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST
@ -615,7 +615,7 @@ class RawDCERPCTest(TestCase):
if hexdump: if hexdump:
sys.stderr.write("generate_auth: %d\n%s" % (len(ai), self.hexdump(ai))) sys.stderr.write("generate_auth: %d\n%s" % (len(ai), self.hexdump(ai)))
else: else:
ai = "" ai = b""
return ai return ai