From: Stefan Metzmacher Date: Tue, 20 Nov 2018 14:15:04 +0000 (+0100) Subject: py:dcerpc/raw_testcase: prepare get_auth_context_creds() and do_generic_bind() for... X-Git-Tag: tdb-1.3.17~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78a5e4ec6e2bd486f64358f10c79bad240f34ac5;p=thirdparty%2Fsamba.git py:dcerpc/raw_testcase: prepare get_auth_context_creds() and do_generic_bind() for header signing 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 Reviewed-by: Jeremy Allison --- diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py index 8d213e5ac79..b7882beadf1 100644 --- a/python/samba/tests/dcerpc/raw_testcase.py +++ b/python/samba/tests/dcerpc/raw_testcase.py @@ -123,7 +123,8 @@ class RawDCERPCTest(TestCase): def get_auth_context_creds(self, creds, auth_type, auth_level, auth_context_id, - g_auth_level=None): + g_auth_level=None, + hdr_signing=False): if g_auth_level is None: g_auth_level = auth_level @@ -146,6 +147,7 @@ class RawDCERPCTest(TestCase): auth_context["auth_context_id"] = auth_context_id auth_context["g_auth_level"] = g_auth_level auth_context["gensec"] = g + auth_context["hdr_signing"] = hdr_signing auth_context["expect_3legs"] = expect_3legs return auth_context @@ -158,6 +160,9 @@ class RawDCERPCTest(TestCase): ctx_list = [ctx] if auth_context is not None: + if auth_context['hdr_signing']: + pfc_flags |= dcerpc.DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN + expect_3legs = auth_context["expect_3legs"] from_server = b"" @@ -227,6 +232,8 @@ class RawDCERPCTest(TestCase): (finished, to_server) = auth_context["gensec"].update(from_server) if expect_3legs: self.assertTrue(finished) + if auth_context['hdr_signing']: + auth_context["gensec"].want_feature(gensec.FEATURE_SIGN_PKT_HEADER) else: self.assertFalse(finished) @@ -281,6 +288,8 @@ class RawDCERPCTest(TestCase): from_server = a.credentials (finished, to_server) = auth_context["gensec"].update(from_server) self.assertTrue(finished) + if auth_context['hdr_signing']: + auth_context["gensec"].want_feature(gensec.FEATURE_SIGN_PKT_HEADER) return ack