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

tests/dcerpc/raw_protocol: split test_spnego_connect_request() into 2 parts

This can be a generic test that can be used for more auth_levels.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2019-08-01 13:04:16 +02:00 committed by Andreas Schneider
parent c226dc6e8a
commit ff2f20439c

View File

@ -2611,7 +2611,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertIsNone(rep)
self.assertNotConnected()
def test_spnego_connect_request(self):
def _test_spnego_connect_upgrade_request(self, upgrade_auth_level):
ndr32 = base.transfer_syntax_ndr()
tsf1_list = [ndr32]
@ -2730,9 +2730,9 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertEquals(rep.u.cancel_count, 0)
self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
# Now a request with auth_info DCERPC_AUTH_LEVEL_INTEGRITY
# Now a request with auth_info upgrade_auth_level
auth_info = self.generate_auth(auth_type=auth_type,
auth_level=dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY,
auth_level=upgrade_auth_level,
auth_context_id=auth_context_id,
auth_blob=b"\x01" + b"\x00" * 15)
req = self.generate_request(call_id=4,
@ -2758,6 +2758,10 @@ class TestDCERPC_BIND(RawDCERPCTest):
self.assertIsNone(rep)
self.assertNotConnected()
def test_spnego_connect_integrity_upgrade(self):
return self._test_spnego_connect_upgrade_request(
dcerpc.DCERPC_AUTH_LEVEL_INTEGRITY)
def test_spnego_integrity_request(self):
ndr32 = base.transfer_syntax_ndr()