py:dcerpc/raw_protocol: let self._test_spnego_bind_auth_level() return auth_context
authorStefan Metzmacher <metze@samba.org>
Tue, 20 Nov 2018 14:38:06 +0000 (15:38 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 23 Dec 2018 17:15:20 +0000 (18:15 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/tests/dcerpc/raw_protocol.py

index 3ac3efe..6a8e064 100755 (executable)
@@ -4382,7 +4382,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
                                    alter_fault=alter_fault)
         if ack is None:
             return None
-        return auth_context["gensec"]
+        return auth_context
 
     def _test_spnego_level_bind_nak(self, auth_level,
                                     reason=dcerpc.DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM):
@@ -4407,15 +4407,16 @@ class TestDCERPC_BIND(RawDCERPCTest):
         auth_type = dcerpc.DCERPC_AUTH_TYPE_SPNEGO
         auth_context_id = 2
 
-        g = self._test_spnego_bind_auth_level(auth_level=auth_level,
+        auth_context = self._test_spnego_bind_auth_level(auth_level=auth_level,
                                               auth_context_id=auth_context_id,
                                               ctx=ctx1,
                                               g_auth_level=g_auth_level,
                                               alter_fault=alter_fault)
-
         if request_fault is None:
             return
 
+        self.assertIsNotNone(auth_context)
+        g = auth_context["gensec"]
         self.assertIsNotNone(g)
 
         stub_bin = b'\x00' * 17
@@ -4582,9 +4583,12 @@ class TestDCERPC_BIND(RawDCERPCTest):
         auth_type = dcerpc.DCERPC_AUTH_TYPE_SPNEGO
         auth_context_id = 2
 
-        g = self._test_spnego_bind_auth_level(auth_level=auth_level,
+        auth_context = self._test_spnego_bind_auth_level(auth_level=auth_level,
                                               auth_context_id=auth_context_id,
                                               ctx=ctx1)
+        self.assertIsNotNone(auth_context)
+        g = auth_context["gensec"]
+        self.assertIsNotNone(g)
 
         stub_bin = b'\x00' * 0
         mod_len = len(stub_bin) % dcerpc.DCERPC_AUTH_PAD_ALIGNMENT