summaryrefslogtreecommitdiff
path: root/python/samba/tests
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-11-17 10:05:41 +0100
committerAndreas Schneider <asn@cryptomilk.org>2024-10-10 14:01:04 +0000
commit57fb07f5a3369d679f8918f853303b56e58dfb3d (patch)
tree5dbca43be4520cddc86c1c2ac2ce09fcd7448041 /python/samba/tests
parent09e8dd23ce0c08c5c04bd74121f3664f420af877 (diff)
downloadsamba-57fb07f5a3369d679f8918f853303b56e58dfb3d.tar.gz
samba-57fb07f5a3369d679f8918f853303b56e58dfb3d.tar.bz2
samba-57fb07f5a3369d679f8918f853303b56e58dfb3d.zip
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>
Diffstat (limited to 'python/samba/tests')
-rwxr-xr-xpython/samba/tests/dcerpc/raw_protocol.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py
index 6d2220674df..af6562d60da 100755
--- a/python/samba/tests/dcerpc/raw_protocol.py
+++ b/python/samba/tests/dcerpc/raw_protocol.py
@@ -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()