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

tests/dcerpc/raw_protocol: test_no_auth_ctx_request

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2020-11-17 10:05:41 +01:00 committed by Andreas Schneider
parent 09e8dd23ce
commit 57fb07f5a3

View File

@ -8003,6 +8003,39 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertIsNone(rep)
self.assertNotConnected()
def test_no_auth_ctx_request(self):
abstract = samba.dcerpc.mgmt.abstract_syntax()
transfer = base.transfer_syntax_ndr()
tsf1_list = [transfer]
ctx = samba.dcerpc.dcerpc.ctx_list()
ctx.context_id = 1
ctx.num_transfer_syntaxes = len(tsf1_list)
ctx.abstract_syntax = abstract
ctx.transfer_syntaxes = tsf1_list
auth_context = {}
auth_context["auth_type"] = 0
auth_context["auth_level"] = 0
auth_context["auth_context_id"] = 0
auth_context["g_auth_level"] = 0
auth_context["gensec"] = None
auth_context["hdr_signing"] = False
auth_context["expect_3legs"] = False
ack0 = self.do_generic_bind(call_id=1, ctx=ctx)
inq_if_ids = samba.dcerpc.mgmt.inq_if_ids()
self.do_single_request(call_id=2, ctx=ctx, io=inq_if_ids,
auth_context=auth_context,
fault_status=dcerpc.DCERPC_FAULT_ACCESS_DENIED)
# wait for a disconnect
rep = self.recv_pdu()
self.assertIsNone(rep)
self.assertNotConnected()
def test_multiple_auth_limit(self):
creds = self.get_user_creds()